Record Class ExpressionOrLiteralArgument<ENVIRONMENT extends IScratchEnvironment,TYPE>
java.lang.Object
java.lang.Record
com.petrolpark.core.scratch.argument.ExpressionOrLiteralArgument<ENVIRONMENT,TYPE>
- All Implemented Interfaces:
IScratchArgument<ENVIRONMENT,,TYPE> IScratchContextHolder
public record ExpressionOrLiteralArgument<ENVIRONMENT extends IScratchEnvironment,TYPE> (TYPE value, Optional<ExpressionArgument<ENVIRONMENT extends IScratchEnvironment,TYPE,?>> expression, ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT extends IScratchEnvironment,TYPE> parameter)
extends Record
implements IScratchArgument<ENVIRONMENT,TYPE>, IScratchContextHolder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT extends IScratchEnvironment,TYPE> -
Constructor Summary
ConstructorsConstructorDescriptionExpressionOrLiteralArgument(TYPE value, Optional<ExpressionArgument<ENVIRONMENT, TYPE, ?>> expression, ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT, TYPE> parameter) Creates an instance of aExpressionOrLiteralArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.static <ENVIRONMENT extends IScratchEnvironment>
ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT, Long> integerParameter(String key) Returns the value of theparameterrecord component.<CONTEXT extends IScratchContext<CONTEXT>>
voidpopulateContext(IScratchContextProvider<CONTEXT> contextProvider, CONTEXT context) static <ENVIRONMENT extends IScratchEnvironment>
ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT, Double> realParameter(String key) static <ENVIRONMENT extends IScratchEnvironment>
ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT, String> stringParameter(String key) final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
ExpressionOrLiteralArgument
public ExpressionOrLiteralArgument(TYPE value, Optional<ExpressionArgument<ENVIRONMENT, TYPE, ?>> expression, ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT, TYPE> parameter) Creates an instance of aExpressionOrLiteralArgumentrecord class.- Parameters:
value- the value for thevaluerecord componentexpression- the value for theexpressionrecord componentparameter- the value for theparameterrecord component
-
-
Method Details
-
integerParameter
public static <ENVIRONMENT extends IScratchEnvironment> ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT,Long> integerParameter(String key) -
realParameter
public static <ENVIRONMENT extends IScratchEnvironment> ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT,Double> realParameter(String key) -
stringParameter
public static <ENVIRONMENT extends IScratchEnvironment> ExpressionOrLiteralArgument.ExpressionOrLiteralParameter<ENVIRONMENT,String> stringParameter(String key) -
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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
expression
Returns the value of theexpressionrecord component.- Returns:
- the value of the
expressionrecord component
-
parameter
Returns the value of theparameterrecord component.- Specified by:
parameterin interfaceIScratchArgument<ENVIRONMENT extends IScratchEnvironment,TYPE> - Returns:
- the value of the
parameterrecord component
-