|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.model.LabelValue
public class LabelValue
A simple JavaBean to represent label-value pairs. This is most commonly used
when constructing user interface elements which have a label to be displayed
to the user, and a corresponding value to be returned to the server. One
example is the <html:options>
tag.
Note: this class has a natural ordering that is inconsistent with equals.
Field Summary | |
---|---|
static java.util.Comparator<LabelValue> |
CASE_INSENSITIVE_ORDER
Comparator that can be used for a case insensitive sort of LabelValue objects. |
Constructor Summary | |
---|---|
LabelValue()
Default constructor. |
|
LabelValue(java.lang.String label,
java.lang.String value)
Construct an instance with the supplied property values. |
Method Summary | |
---|---|
int |
compareTo(LabelValue o)
Compare LabelValueBeans based on the label, because that's the human viewable part of the object. |
boolean |
equals(java.lang.Object obj)
LabelValueBeans are equal if their values are both null or equal. |
java.lang.String |
getLabel()
|
java.lang.String |
getValue()
|
int |
hashCode()
The hash code is based on the object's value. |
void |
setLabel(java.lang.String label)
|
void |
setValue(java.lang.String value)
|
java.lang.String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.util.Comparator<LabelValue> CASE_INSENSITIVE_ORDER
LabelValue
objects.
Constructor Detail |
---|
public LabelValue()
public LabelValue(java.lang.String label, java.lang.String value)
label
- The label to be displayed to the user.value
- The value to be returned to the server.Method Detail |
---|
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public java.lang.String getValue()
public void setValue(java.lang.String value)
public int compareTo(LabelValue o)
compareTo
in interface java.lang.Comparable<LabelValue>
o
- LabelValue object to compare to
Comparable
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- object to compare to
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |