Record Class AttributedText
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.designer.mvvm.binders.swing.AttributedText
- Record Components:
text
- The text to be displayedattributes
- The attributes to be applied to segments of the texttimestamp
- The time when the text was last modified. This is optional, and can be null.
public record AttributedText(String text, List<AttributeSpan> attributes, @Nullable LocalDateTime timestamp)
extends Record
The
text
can have multiple segments with different attributes applied to them. Those segments are defined by
the attributes
list which specifies what attributes should be applied to what segments of the text using
AttributeSpan
s.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAttributedText
(String text, List<AttributeSpan> attributes) AttributedText
(String text, List<AttributeSpan> attributes, LocalDateTime timestamp) Creates an instance of aAttributedText
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributes
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.text()
Returns the value of thetext
record component.Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
AttributedText
-
AttributedText
public AttributedText(String text, List<AttributeSpan> attributes, @Nullable LocalDateTime timestamp) Creates an instance of aAttributedText
record class.- Parameters:
text
- the value for thetext
record componentattributes
- the value for theattributes
record componenttimestamp
- the value for thetimestamp
record component
-
-
Method Details
-
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)
. -
text
Returns the value of thetext
record component.- Returns:
- the value of the
text
record component
-
attributes
Returns the value of theattributes
record component.- Returns:
- the value of the
attributes
record component
-
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-