Record Class SharedTextCarrier
java.lang.Object
java.lang.Record
com.ultikits.ultitools.text.internal.SharedTextCarrier
- Record Components:
text- the original translated text and immutable argumentsfallbackString- plain text for consumers that do not use the framework translator
- All Implemented Interfaces:
net.kyori.adventure.text.VirtualComponentRenderer<Void>
@Internal
public record SharedTextCarrier(Text.Translated text, String fallbackString)
extends Record
implements net.kyori.adventure.text.VirtualComponentRenderer<Void>
Carries the entire deferred text through Adventure without a second argument formatter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thefallbackStringrecord component.private final Text.TranslatedThe field for thetextrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSharedTextCarrier(Text.Translated text, String fallbackString) Creates an instance of aSharedTextCarrierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.Componentfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefallbackStringrecord component.final inthashCode()Returns a hash code value for this object.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
text
The field for thetextrecord component. -
fallbackString
The field for thefallbackStringrecord component.
-
-
Constructor Details
-
SharedTextCarrier
Creates an instance of aSharedTextCarrierrecord class.- Parameters:
text- the value for thetextrecord componentfallbackString- the value for thefallbackStringrecord component
-
-
Method Details
-
apply
-
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). -
text
-
fallbackString
Returns the value of thefallbackStringrecord component.- Specified by:
fallbackStringin interfacenet.kyori.adventure.text.VirtualComponentRenderer<Void>- Returns:
- the value of the
fallbackStringrecord component
-