Record Class TokenRuleEngine.RuleAction

java.lang.Object
java.lang.Record
net.luis.utils.io.token.rule.TokenRuleEngine.RuleAction
Record Components:
tokenRule - The token rule
action - The action to be applied to the matched tokens
Enclosing class:
TokenRuleEngine

private static record TokenRuleEngine.RuleAction(@NotNull TokenRule tokenRule, @NotNull TokenAction action) extends Record
A record that holds a token rule and its associated action.
  • Field Details

    • tokenRule

      @NotNull private final @NotNull TokenRule tokenRule
      The field for the tokenRule record component.
    • action

      @NotNull private final @NotNull TokenAction action
      The field for the action record component.
  • Constructor Details

    • RuleAction

      private RuleAction(@NotNull @NotNull TokenRule tokenRule, @NotNull @NotNull TokenAction action)
      Constructs a new rule action with the given token rule and action.
      Parameters:
      tokenRule - The token rule
      action - The action to be applied to the matched tokens
      Throws:
      NullPointerException - If the rule or action is null
  • 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.
    • tokenRule

      @NotNull public @NotNull TokenRule tokenRule()
      Returns the value of the tokenRule record component.
      Returns:
      the value of the tokenRule record component
    • action

      @NotNull public @NotNull TokenAction action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component