Record Class TextArgument
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.text.TextArgument
- Record Components:
argument- The argument represented by this TextArgument. It is the value that will be used for variable substitution into the pattern String.component- The optional text component to use for the text. This can be used to override the decorations of the surrounding text for the argument.
public record TextArgument(@Nullable Object argument, @Nullable TextComponent component)
extends Record
Represents an argument in a piece of text.
For example given a String "Hello there, {0}", the TextArgument can be used to provide the substitution for "{0}".
-
Constructor Summary
ConstructorsConstructorDescriptionTextArgument(@Nullable Object argument, @Nullable TextComponent component) Creates an instance of aTextArgumentrecord class.TextArgument(@Nullable String text) -
Method Summary
Modifier and TypeMethodDescription@Nullable Objectargument()Returns the value of theargumentrecord component.@Nullable TextComponentReturns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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). -
argument
-
component
-