java.lang.Object
java.lang.Record
net.luis.utils.io.token.rule.actions.GroupingTokenAction
- Record Components:
definition
- The definition of the token group
- All Implemented Interfaces:
TokenAction
public record GroupingTokenAction(@NotNull TokenDefinition definition)
extends Record
implements TokenAction
Token action that groups the tokens into a single token group.
The value of the group must match the definition of this action.
The value of the group must match the definition of this action.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull TokenDefinition
The field for thedefinition
record component. -
Constructor Summary
ConstructorsConstructorDescriptionGroupingTokenAction
(@NotNull TokenDefinition definition) Constructs a new grouping token action with the given definition. -
Method Summary
Modifier and TypeMethodDescriptionapply
(@NotNull TokenRuleMatch match) Applies this token action to the given token rule match.
The action can modify, transform or remove the tokens of the match.@NotNull TokenDefinition
Returns the value of thedefinition
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.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
definition
The field for thedefinition
record component.
-
-
Constructor Details
-
GroupingTokenAction
Constructs a new grouping token action with the given definition.- Parameters:
definition
- The definition of the token group- Throws:
NullPointerException
- If the definition is null
-
-
Method Details
-
apply
Description copied from interface:TokenAction
Applies this token action to the given token rule match.
The action can modify, transform or remove the tokens of the match.- Specified by:
apply
in interfaceTokenAction
- Parameters:
match
- The token rule match to apply the action to- Returns:
- The resulting immutable list of tokens after applying the action
-
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)
. -
definition
Returns the value of thedefinition
record component.- Returns:
- the value of the
definition
record component
-