Interface Item<T>
- Type Parameters:
T- the type of the value
-
Method Summary
Modifier and TypeMethodDescriptioncaption()get()default Tstatic <T> Item<T> Creates a newItem, which gets its caption from a resource bundle.static <T> Item<T> Returns anItem, with the caption as value.toString() or an empty string in case of a null valuestatic <T> Item<T> Creates a newItem.
-
Method Details
-
caption
String caption()- Returns:
- the caption
-
get
-
getOrThrow
- Returns:
- the item value
- Throws:
NoSuchElementException- if no value is present
-
item
-
item
-
i18n
Creates a newItem, which gets its caption from a resource bundle. Note that the caption is cached, so that changing theLocaleafter 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
-