java.lang.Object
java.lang.Record
net.luis.utils.io.token.rule.TokenRuleEngine.RuleAction
- Record Components:
tokenRule
- The token ruleaction
- 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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RuleAction
(@NotNull TokenRule tokenRule, @NotNull TokenAction action) Constructs a new rule action with the given token rule and action. -
Method Summary
Modifier and TypeMethodDescription@NotNull TokenAction
action()
Returns the value of theaction
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull TokenRule
Returns the value of thetokenRule
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
RuleAction
Constructs a new rule action with the given token rule and action.- Parameters:
tokenRule
- The token ruleaction
- The action to be applied to the matched tokens- Throws:
NullPointerException
- If the rule or action is null
-
-
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)
. -
tokenRule
Returns the value of thetokenRule
record component.- Returns:
- the value of the
tokenRule
record component
-
action
Returns the value of theaction
record component.- Returns:
- the value of the
action
record component
-