Package org.omnifaces.util.selectitems
Class SelectItemsBuilder
- java.lang.Object
-
- org.omnifaces.util.selectitems.SelectItemsBuilder
-
public class SelectItemsBuilder extends Object
Helper class to build an array of SelectItems using various means, like via the builder pattern or a givenMap
.- Author:
- Arjan Tijms
-
-
Constructor Summary
Constructors Constructor Description SelectItemsBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectItemsBuilder
add(Object value, String label)
SelectItem[]
build()
List<SelectItem>
buildList()
static List<SelectItem>
fromMap(Map<?,?> map)
Builds aList
ofSelectItem
s from the givenMap
argument.
-
-
-
Method Detail
-
add
public SelectItemsBuilder add(Object value, String label)
-
build
public SelectItem[] build()
-
buildList
public List<SelectItem> buildList()
-
fromMap
public static List<SelectItem> fromMap(Map<?,?> map)
Builds aList
ofSelectItem
s from the givenMap
argument.- Parameters:
map
- the Map- Returns:
List
ofSelectItem
s having the map's value as value and the map's key as label.
-
-