T
- the type of the valuepublic final class Item<T> extends java.lang.Object implements java.lang.Comparable<Item>, java.io.Serializable
Constructor and Description |
---|
Item(T value)
Instantiates a new Item, with the caption as item.toString() or an empty string in case of a null value
|
Item(T value,
java.lang.String caption)
Instantiates a new Item.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Item item)
Compares this items caption with the caption of the given item
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getCaption() |
T |
getValue() |
int |
hashCode() |
java.lang.String |
toString() |
public Item(T value)
value
- the value, may be nullpublic Item(T value, java.lang.String caption)
value
- the value, may be nullcaption
- the captionjava.lang.NullPointerException
- if caption is nullpublic java.lang.String getCaption()
public T getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object