Record Class VariableArgument
java.lang.Object
java.lang.Record
com.petrolpark.core.scratch.argument.VariableArgument
- All Implemented Interfaces:
IScratchArgument<IVariableScratchEnvironment,ScratchVariableIdentifier>
public record VariableArgument(ScratchVariableIdentifier identifier, VariableArgument.VariableParameter parameter)
extends Record
implements IScratchArgument<IVariableScratchEnvironment,ScratchVariableIdentifier>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionVariableArgument(ScratchVariableIdentifier identifier, VariableArgument.VariableParameter parameter) Creates an instance of aVariableArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this Argument can evaluate without crashing.final booleanIndicates whether some other object is "equal to" this one.get(IVariableScratchEnvironment environment) final inthashCode()Returns a hash code value for this object.Returns the value of theidentifierrecord component.Returns the value of theparameterrecord component.final StringtoString()Returns a string representation of this record class.static final VariableArgument.VariableParameter
-
Constructor Details
-
VariableArgument
public VariableArgument(ScratchVariableIdentifier identifier, VariableArgument.VariableParameter parameter) Creates an instance of aVariableArgumentrecord class.- Parameters:
identifier- the value for theidentifierrecord componentparameter- the value for theparameterrecord component
-
-
Method Details
-
variable
-
get
- Specified by:
getin interfaceIScratchArgument<IVariableScratchEnvironment,ScratchVariableIdentifier>
-
canEvaluate
public boolean canEvaluate()Description copied from interface:IScratchArgumentWhether this Argument can evaluate without crashing.- Specified by:
canEvaluatein interfaceIScratchArgument<IVariableScratchEnvironment,ScratchVariableIdentifier>
-
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). -
identifier
Returns the value of theidentifierrecord component.- Returns:
- the value of the
identifierrecord component
-
parameter
Returns the value of theparameterrecord component.- Specified by:
parameterin interfaceIScratchArgument<IVariableScratchEnvironment,ScratchVariableIdentifier> - Returns:
- the value of the
parameterrecord component
-