Class CheckboxSelectable<T>

java.lang.Object
io.goobi.viewer.model.jsf.CheckboxSelectable<T>
Type Parameters:
T - the type of the selectable value

public class CheckboxSelectable<T> extends Object
Wraps a single value together with a backing collection to model a checkbox selection state, where the checkbox is considered selected when the value is present in the collection.
  • Constructor Details

    • CheckboxSelectable

      public CheckboxSelectable(Collection<T> dataSet, T value, Function<T,String> labelGetter)
      Parameters:
      dataSet - collection backing the checkbox selection state
      value - the value represented by this checkbox
      labelGetter - function to derive the display label from the value
  • Method Details

    • isSelected

      public boolean isSelected()
    • setSelected

      public void setSelected(boolean selected)
      Parameters:
      selected - true to add value to data set; false to remove it
    • getLabel

      public String getLabel()
    • toString

      public String toString()
      Overrides:
      toString in class Object