|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pfsw.text.StringPair
public class StringPair
A simple pair of strings.
| Field Summary | |
|---|---|
static StringPair[] |
EMPTY_ARRAY
|
static int |
NULL_HASHCODE
Defines the hash code of instances that contain two null strings. |
| Fields inherited from interface org.pfsw.bif.text.IJSONConvertible |
|---|
JSON_ARRAY_END, JSON_ARRAY_START, JSON_ELEMENT_SEPARATOR, JSON_LITERAL_FALSE, JSON_LITERAL_NULL, JSON_LITERAL_TRUE, JSON_OBJECT_END, JSON_OBJECT_START, JSON_PAIR_SEPARATOR, JSON_STRING_DELIMITER, JSON_STRING_ESCAPE |
| Constructor Summary | |
|---|---|
StringPair()
Initialize the new instance with default values. |
|
StringPair(org.pfsw.bif.text.IStringPair pair)
Initialize the new instance from the given string pair. |
|
StringPair(java.lang.String string)
Initialize the new instance with one string. |
|
StringPair(java.lang.String[] strings)
Initialize the new instance with two strings in an array. |
|
StringPair(java.lang.String s1,
java.lang.String s2)
Initialize the new instance with two strings. |
|
| Method Summary | |
|---|---|
void |
appendAsJSONString(java.lang.Appendable output)
Appends the internal state as JSON string representation to the given buffer. |
java.lang.String[] |
asArray()
Returns both strings of this pair in a String array. |
java.lang.String |
asString()
Returns the string representation of the pair with the default separator. |
java.lang.String |
asString(java.lang.String separator)
Returns the two strings as one string separated by the given separator. |
boolean |
equals(java.lang.Object obj)
Returns true if the given object is an IStringPair and its both strings are equal to the corresponding two strings of this object. |
java.lang.String |
getDefaultSeparator()
Returns the default separator (here ":"). |
java.lang.String |
getString1()
|
java.lang.String |
getString2()
|
int |
hashCode()
Returns a hash built over the two contained strings. |
protected boolean |
isEqual(java.lang.String s1,
java.lang.String s2)
|
void |
setString1(java.lang.String newValue)
|
void |
setString2(java.lang.String newValue)
|
java.lang.String |
toJSON()
Returns a JSON string representation of this object. |
java.lang.String |
toString()
Returns the two strings with the default separator in between. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final StringPair[] EMPTY_ARRAY
public static final int NULL_HASHCODE
| Constructor Detail |
|---|
public StringPair()
public StringPair(java.lang.String string)
public StringPair(java.lang.String s1,
java.lang.String s2)
public StringPair(org.pfsw.bif.text.IStringPair pair)
public StringPair(java.lang.String[] strings)
java.lang.IllegalArgumentException - If the array does not contain exactly 2 elements.| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void appendAsJSONString(java.lang.Appendable output)
appendAsJSONString in interface org.pfsw.bif.text.IJSONConvertibleoutput - The buffer to which to append the JSON string (must not be null).public java.lang.String toJSON()
toJSON in interface org.pfsw.bif.text.IJSONConvertiblepublic java.lang.String[] asArray()
asArray in interface org.pfsw.bif.text.IStringPairpublic java.lang.String asString()
asString in interface org.pfsw.bif.text.IStringRepresentationpublic java.lang.String asString(java.lang.String separator)
asString in interface org.pfsw.bif.text.IStringPairseparator - A separator to be placed between the two strings.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDefaultSeparator()
public java.lang.String getString1()
getString1 in interface org.pfsw.bif.text.IStringPairpublic void setString1(java.lang.String newValue)
setString1 in interface org.pfsw.bif.text.IMutableStringPairpublic java.lang.String getString2()
getString2 in interface org.pfsw.bif.text.IStringPairpublic void setString2(java.lang.String newValue)
setString2 in interface org.pfsw.bif.text.IMutableStringPair
protected boolean isEqual(java.lang.String s1,
java.lang.String s2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||