- Type Parameters:
T
- the type of the value
public interface Item<T>
-
Method Summary
Modifier and TypeMethodDescriptioncaption()
static <T> Item<T>
item
(T value) Returns anItem
, with the caption as item.toString() or an empty string in case of a null valuestatic <T> Item<T>
Creates a newItem
.static <T> Item<T>
Creates a newItem
, which gets its caption from a resource bundle.value()
-
Method Details
-
value
T value()- Returns:
- the item value
-
item
Returns anItem
, with the caption as item.toString() or an empty string in case of a null value- Type Parameters:
T
- the value type- Parameters:
value
- the value, may be null- Returns:
- an
Item
based on the given value
-
item
Creates a newItem
.- Type Parameters:
T
- the value type- Parameters:
value
- the value, may be nullcaption
- the caption- Returns:
- an
Item
based on the given value and caption - Throws:
NullPointerException
- if caption is null
-
itemI18n
Creates a newItem
, which gets its caption from a resource bundle. Note that the caption is cached, so that changing theLocale
after the first timecaption()
is called will not change the caption.- Type Parameters:
T
- the value type- Parameters:
value
- the value, may be nullresourceBundleName
- the resource bundle nameresourceBundleKey
- the resource bundle key for the item caption- Returns:
- an Item based on the given value and resource bundle