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
Modifier and TypeFieldDescriptionprivate final Dictionary
<com.mojang.brigadier.StringReader> The field for therules
record component.The field for thetop
record component. -
Constructor Summary
ConstructorDescriptionGrammar
(Dictionary<com.mojang.brigadier.StringReader> rules, Atom<T> top) Creates an instance of aGrammar
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
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 therules
record component.top()
Returns the value of thetop
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
rules
The field for therules
record component. -
top
The field for thetop
record component.
-
-
Constructor Details
-
Grammar
Creates an instance of aGrammar
record class.- Parameters:
rules
- the value for therules
record componenttop
- the value for thetop
record 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 therules
record component.- Returns:
- the value of the
rules
record component
-
top
Returns the value of thetop
record component.- Returns:
- the value of the
top
record component
-