Record Class ExpressionArgument<ENVIRONMENT extends IScratchEnvironment,TYPE,ARGUMENTS extends ScratchArguments<ENVIRONMENT,?>>
java.lang.Object
java.lang.Record
com.petrolpark.core.scratch.argument.ExpressionArgument<ENVIRONMENT,TYPE,ARGUMENTS>
- All Implemented Interfaces:
IScratchArgument<ENVIRONMENT,,TYPE> IScratchContextHolder
public record ExpressionArgument<ENVIRONMENT extends IScratchEnvironment,TYPE,ARGUMENTS extends ScratchArguments<ENVIRONMENT,?>> (IScratchExpression<ENVIRONMENT extends IScratchEnvironment,TYPE,ARGUMENTS extends ScratchArguments<ENVIRONMENT,?>,?> expression, ARGUMENTS extends ScratchArguments<ENVIRONMENT,?> arguments, ExpressionArgument.ExpressionParameter<ENVIRONMENT extends IScratchEnvironment,TYPE> parameter)
extends Record
implements IScratchArgument<ENVIRONMENT,TYPE>, IScratchContextHolder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionExpressionArgument(IScratchExpression<ENVIRONMENT, TYPE, ARGUMENTS, ?> expression, ARGUMENTS arguments, ExpressionArgument.ExpressionParameter<ENVIRONMENT, TYPE> parameter) Creates an instance of aExpressionArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionrecord component.get(ENVIRONMENT environment) final inthashCode()Returns a hash code value for this object.Returns the value of theparameterrecord component.static final <ENVIRONMENT extends IScratchEnvironment,TYPE>
ExpressionArgument.ExpressionParameter<ENVIRONMENT, TYPE> parameter(String key, IScratchClass<TYPE, ?> scratchClass) <CONTEXT extends IScratchContext<CONTEXT>>
voidpopulateContext(IScratchContextProvider<CONTEXT> contextProvider, CONTEXT context) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ExpressionArgument
public ExpressionArgument(IScratchExpression<ENVIRONMENT, TYPE, ARGUMENTS, ?> expression, ARGUMENTS arguments, ExpressionArgument.ExpressionParameter<ENVIRONMENT, TYPE> parameter) Creates an instance of aExpressionArgumentrecord class.- Parameters:
expression- the value for theexpressionrecord componentarguments- the value for theargumentsrecord componentparameter- the value for theparameterrecord component
-
-
Method Details
-
parameter
public static final <ENVIRONMENT extends IScratchEnvironment,TYPE> ExpressionArgument.ExpressionParameter<ENVIRONMENT,TYPE> parameter(String key, IScratchClass<TYPE, ?> scratchClass) -
get
- Specified by:
getin interfaceIScratchArgument<ENVIRONMENT extends IScratchEnvironment,TYPE>
-
populateContext
public <CONTEXT extends IScratchContext<CONTEXT>> void populateContext(IScratchContextProvider<CONTEXT> contextProvider, CONTEXT context) - Specified by:
populateContextin interfaceIScratchContextHolder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
expression
Returns the value of theexpressionrecord component.- Returns:
- the value of the
expressionrecord component
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
parameter
Returns the value of theparameterrecord component.- Specified by:
parameterin interfaceIScratchArgument<ENVIRONMENT extends IScratchEnvironment,TYPE> - Returns:
- the value of the
parameterrecord component
-