Package net.minecraft.commands.functions
Record Class StringTemplate
java.lang.Object
java.lang.Record
net.minecraft.commands.functions.StringTemplate
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStringTemplate(List<String> segments, List<String> variables) Creates an instance of aStringTemplaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static StringTemplatefromString(String p_306229_, int p_305937_) final inthashCode()Returns a hash code value for this object.private static booleanisValidVariableName(String p_306141_) segments()Returns the value of thesegmentsrecord component.substitute(List<String> p_306329_) final StringtoString()Returns a string representation of this record class.Returns the value of thevariablesrecord component.
-
Field Details
-
segments
The field for thesegmentsrecord component. -
variables
The field for thevariablesrecord component.
-
-
Constructor Details
-
StringTemplate
Creates an instance of aStringTemplaterecord class.- Parameters:
segments- the value for thesegmentsrecord componentvariables- the value for thevariablesrecord 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 thesegmentsrecord component.- Returns:
- the value of the
segmentsrecord component
-
variables
Returns the value of thevariablesrecord component.- Returns:
- the value of the
variablesrecord component
-