public class NamedText extends NamedValue<java.lang.String> implements IMutableStringPair
EMPTY_ARRAY
Constructor and Description |
---|
NamedText(java.lang.String name,
java.lang.String text)
Initialize the new instance with the given name and value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
asArray()
Returns both strings of this pair in a String array.
|
java.lang.String |
asString(java.lang.String separator)
Returns the two strings as one string separated by the given separator.
|
NamedText |
copy()
Returns a copy of this object
|
NamedText |
copyNamedText()
Returns a copy of this object
|
java.lang.String |
getString1()
Returns the first string of this pair.
|
java.lang.String |
getString2()
Returns the second string of this pair.
|
static NamedText |
of(java.lang.String name,
java.lang.String text)
Creates a new instance with a name and an associated text.
|
void |
setString1(java.lang.String string)
Sets the first string to the given value.
|
void |
setString2(java.lang.String string)
Sets the second string to the given value.
|
java.lang.String |
text()
Returns the text (value) of the association.
|
void |
text(java.lang.String newText)
Sets the text (value) of the association.
|
void |
value(java.lang.String newText)
Sets the text (value) of the association.
|
compareTo, copyNamedValue, key, name, name
copyAssociation, equals, getKey, getValue, hashCode, key, setValue, toString, value
public NamedText(java.lang.String name, java.lang.String text)
public static NamedText of(java.lang.String name, java.lang.String text)
public void value(java.lang.String newText)
value
in class Association<java.lang.String,java.lang.String>
newText
- The new text (a null value will be ignored)public void text(java.lang.String newText)
newText
- The new text (a null value will be ignored)public java.lang.String text()
public NamedText copy()
public NamedText copyNamedText()
public java.lang.String getString1()
IStringPair
getString1
in interface IStringPair
public void setString1(java.lang.String string)
IMutableStringPair
setString1
in interface IMutableStringPair
string
- The new value (may be null).public java.lang.String getString2()
IStringPair
getString2
in interface IStringPair
public void setString2(java.lang.String string)
IMutableStringPair
setString2
in interface IMutableStringPair
string
- The new value (may be null).public java.lang.String[] asArray()
IStringPair
asArray
in interface IStringPair
public java.lang.String asString(java.lang.String separator)
IStringPair
asString
in interface IStringPair
separator
- A separator to be placed between the two strings.