Record Class Grammar<T>
java.lang.Object
java.lang.Record
net.minecraft.util.parsing.packrat.commands.Grammar<T>
public record Grammar<T>(Dictionary<com.mojang.brigadier.StringReader> rules, Atom<T> top)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Dictionary<com.mojang.brigadier.StringReader> The field for therulesrecord component.The field for thetoprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGrammar(Dictionary<com.mojang.brigadier.StringReader> rules, Atom<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<com.mojang.brigadier.StringReader> p_335989_) parseForCommands(com.mojang.brigadier.StringReader p_336148_) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> parseForSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_335783_) Dictionary<com.mojang.brigadier.StringReader> rules()Returns the value of therulesrecord component.top()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.
-
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
public T parseForCommands(com.mojang.brigadier.StringReader p_336148_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseForSuggestions
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> parseForSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_335783_) -
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). -
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
-