org.omnifaces.util.selectitems
Class SelectItemsBuilder
java.lang.Object
org.omnifaces.util.selectitems.SelectItemsBuilder
public class SelectItemsBuilder
- extends java.lang.Object
Helper class to build an array of SelectItems using various means, like via the builder pattern or a given Map
.
- Author:
- Arjan Tijms
Method Summary |
SelectItemsBuilder |
add(java.lang.Object value,
java.lang.String label)
|
javax.faces.model.SelectItem[] |
build()
|
java.util.List<javax.faces.model.SelectItem> |
buildList()
|
static java.util.List<javax.faces.model.SelectItem> |
fromMap(java.util.Map<?,?> map)
Builds a List of SelectItem s from the given Map argument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SelectItemsBuilder
public SelectItemsBuilder()
add
public SelectItemsBuilder add(java.lang.Object value,
java.lang.String label)
build
public javax.faces.model.SelectItem[] build()
buildList
public java.util.List<javax.faces.model.SelectItem> buildList()
fromMap
public static java.util.List<javax.faces.model.SelectItem> fromMap(java.util.Map<?,?> map)
- Builds a
List
of SelectItem
s from the given Map
argument.
- Parameters:
map
- the Map
- Returns:
List
of SelectItem
s having the map's value as value and the map's key as label.