Record Class Grammar<T>
java.lang.Object
java.lang.Record
net.minecraft.util.parsing.packrat.commands.Grammar<T>
- All Implemented Interfaces:
CommandArgumentParser<T>
public record Grammar<T>(Dictionary<StringReader> rules, NamedRule<StringReader, T> top)
extends Record
implements CommandArgumentParser<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Dictionary<StringReader> The field for therulesrecord component.private final NamedRule<StringReader, T> The field for thetoprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGrammar(Dictionary<StringReader> rules, NamedRule<StringReader, T> top) Creates an instance of aGrammarrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parse(ParseState<StringReader> state) parseForCommands(StringReader reader) parseForSuggestions(SuggestionsBuilder suggestionsBuilder) rules()Returns the value of therulesrecord component.top()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface CommandArgumentParser
mapResult, withCodec
-
Field Details
-
rules
The field for therulesrecord component. -
top
The field for thetoprecord component.
-
-
Constructor Details
-
Grammar
Creates an instance of aGrammarrecord class.- Parameters:
rules- the value for therulesrecord componenttop- the value for thetoprecord component
-
-
Method Details
-
parse
-
parseForCommands
- Specified by:
parseForCommandsin interfaceCommandArgumentParser<T>- Throws:
CommandSyntaxException
-
parseForSuggestions
- Specified by:
parseForSuggestionsin interfaceCommandArgumentParser<T>
-
toString
-
hashCode
-
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). -
rules
Returns the value of therulesrecord component.- Returns:
- the value of the
rulesrecord component
-
top
Returns the value of thetoprecord component.- Returns:
- the value of the
toprecord component
-