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 given Map.
Author:
Arjan Tijms
  • Constructor Details

    • SelectItemsBuilder

      public SelectItemsBuilder()
  • Method Details

    • 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 a List of SelectItems from the given Map argument.
      Parameters:
      map - the Map
      Returns:
      List of SelectItems having the map's value as value and the map's key as label.