public final class CaseInsensitiveString extends java.lang.Object implements java.lang.Comparable<CaseInsensitiveString>
Modifier and Type | Field and Description |
---|---|
private int |
hashCode
The hash code of the lcValue used for quick comparison.
|
private java.lang.String |
lcValue
The case-insensitive string, used for final comparison.
|
private java.lang.String |
value
The key value.
|
Constructor and Description |
---|
CaseInsensitiveString(java.lang.String value)
The constructor creates the object and initializes the final fields.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CaseInsensitiveString o)
Compare this instance with the received parameter.
|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
|
java.lang.String |
getValue()
Obtain the key value.
|
int |
hashCode()
Returns the hash-code of this object used for quick comparisons.
|
java.lang.String |
toString()
Returns a string representation of this object, in general used for debugging.
|
private final java.lang.String lcValue
private final int hashCode
private final java.lang.String value
public CaseInsensitiveString(java.lang.String value)
value
- The value to be used as key.public java.lang.String getValue()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Other object.true
if the objects are equal (Ie. the key are ignore-case equals).public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(CaseInsensitiveString o)
lcValue
.compareTo
in interface java.lang.Comparable<CaseInsensitiveString>
o
- The other instance.