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 Details

    • EvaluationContext

      public EvaluationContext(CommandLexer lexer, ArgumentMapper mapper)
      Parameters:
      lexer - The lexer used to tokenize the command
      mapper - 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 a EvaluationContext record class.
      Parameters:
      lexer - the value for the lexer record component
      mapper - the value for the mapper record component
      externalRequirementFactories - the value for the externalRequirementFactories record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • lexer

      public CommandLexer lexer()
      Returns the value of the lexer record component.
      Returns:
      the value of the lexer record component
    • mapper

      public ArgumentMapper mapper()
      Returns the value of the mapper record component.
      Returns:
      the value of the mapper record component
    • externalRequirementFactories

      public Map<Class<? extends Annotation>,RequirementFactory> externalRequirementFactories()
      Returns the value of the externalRequirementFactories record component.
      Returns:
      the value of the externalRequirementFactories record component