Package net.minecraft.commands.functions
Record Class StringTemplate
java.lang.Object
java.lang.Record
net.minecraft.commands.functions.StringTemplate
-
Field Summary
-
Constructor Summary
ConstructorDescriptionStringTemplate
(List<String> segments, List<String> variables) Creates an instance of aStringTemplate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static StringTemplate
fromString
(String p_311822_, int p_311237_) final int
hashCode()
Returns a hash code value for this object.private static boolean
isValidVariableName
(String p_312174_) segments()
Returns the value of thesegments
record component.substitute
(List<String> p_310551_) final String
toString()
Returns a string representation of this record class.Returns the value of thevariables
record component.
-
Field Details
-
segments
The field for thesegments
record component. -
variables
The field for thevariables
record component.
-
-
Constructor Details
-
StringTemplate
Creates an instance of aStringTemplate
record class.- Parameters:
segments
- the value for thesegments
record componentvariables
- the value for thevariables
record component
-
-
Method Details
-
fromString
-
isValidVariableName
-
substitute
-
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)
. -
segments
Returns the value of thesegments
record component.- Returns:
- the value of the
segments
record component
-
variables
Returns the value of thevariables
record component.- Returns:
- the value of the
variables
record component
-