Package net.apartium.cocoabeans.commands
Record Class EvaluationContext
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.EvaluationContext
- Record Components:
lexer- The lexer responsible for tokenizing the command.mapper- The mapper used to translate arguments into their corresponding indexes.externalRequirementFactories- A collection of external requirement factories that override built-in behavior or provide custom requirements.
@AvailableSince("0.0.38")
public record EvaluationContext(CommandLexer lexer, ArgumentMapper mapper, Map<Class<? extends Annotation>,RequirementFactory> externalRequirementFactories)
extends Record
Represents the context in which a command is evaluated and processed during registration.
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluationContext(CommandLexer lexer, ArgumentMapper mapper) EvaluationContext(CommandLexer lexer, ArgumentMapper mapper, Map<Class<? extends Annotation>, RequirementFactory> externalRequirementFactories) Creates an instance of aEvaluationContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Map<Class<? extends Annotation>, RequirementFactory> Returns the value of theexternalRequirementFactoriesrecord component.final inthashCode()Returns a hash code value for this object.lexer()Returns the value of thelexerrecord component.mapper()Returns the value of themapperrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvaluationContext
- Parameters:
lexer- The lexer used to tokenize the commandmapper- The mapper used to map arguments into argument indexes
-
EvaluationContext
public EvaluationContext(CommandLexer lexer, ArgumentMapper mapper, Map<Class<? extends Annotation>, RequirementFactory> externalRequirementFactories) Creates an instance of aEvaluationContextrecord class.- Parameters:
lexer- the value for thelexerrecord componentmapper- the value for themapperrecord componentexternalRequirementFactories- the value for theexternalRequirementFactoriesrecord component
-
-
Method Details
-
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). -
lexer
Returns the value of thelexerrecord component.- Returns:
- the value of the
lexerrecord component
-
mapper
Returns the value of themapperrecord component.- Returns:
- the value of the
mapperrecord component
-
externalRequirementFactories
Returns the value of theexternalRequirementFactoriesrecord component.- Returns:
- the value of the
externalRequirementFactoriesrecord component
-