Package de.xima.fc.common.graphdot
Class LabelString
- java.lang.Object
-
- de.xima.fc.common.graphdot.LabelString
-
- All Implemented Interfaces:
Serializable,CharSequence
public final class LabelString extends Object
Represents a label string, either plain text or HTML."hello-world" <<strong>hello world</strong>>
- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LabelString(CharSequence label)Creates a new label string with the given content.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description default charcharAt(int index)default IntStreamchars()default IntStreamcodePoints()booleanequals(Object obj)CharSequencegetLabel()inthashCode()static LabelStringhtml(String html)Uses an HTML text for the label.default intlength()static LabelStringplain(String text)Uses a plain text for the label.default CharSequencesubSequence(int start, int end)StringtoString()
-
-
-
Constructor Detail
-
LabelString
public LabelString(CharSequence label)
Creates a new label string with the given content.- Parameters:
label- Content of the label string.
-
-
Method Detail
-
getLabel
public CharSequence getLabel()
- Returns:
- The label text or HTML.
-
toString
public String toString()
- Specified by:
toStringin interfaceCharSequence
-
html
public static LabelString html(String html)
Uses an HTML text for the label.- Parameters:
html- Label text.- Returns:
- A label string with an HTML text label.
-
plain
public static LabelString plain(String text)
Uses a plain text for the label.- Parameters:
text- Label text.- Returns:
- A label string with a plain text label.
-
charAt
public default char charAt(int index)
- Specified by:
charAtin interfaceCharSequence
-
chars
public default IntStream chars()
- Specified by:
charsin interfaceCharSequence
-
codePoints
public default IntStream codePoints()
- Specified by:
codePointsin interfaceCharSequence
-
length
public default int length()
- Specified by:
lengthin interfaceCharSequence
-
subSequence
public default CharSequence subSequence(int start, int end)
- Specified by:
subSequencein interfaceCharSequence
-
-