Class OptionItem

    • Field Detail

      • LABEL_SORTER

        public static final Comparator<OptionItem> LABEL_SORTER
        Comparator to sort OptionItem by label String value
      • VALUE_SORTER

        public static final Comparator<OptionItem> VALUE_SORTER
        Comparator to sort OptionItem by value String value
    • Constructor Detail

      • OptionItem

        public OptionItem​(String value,
                          String label)
        Creates a new OptionItem with the given label and value.
        Parameters:
        value - the value
        label - the label
      • OptionItem

        public OptionItem​(String valueAndLabel)
        Creates a new OptionItem with the given label and value.
        Parameters:
        valueAndLabel - both the label and value
    • Method Detail

      • getValue

        public String getValue()
        Getter for the value property
        Returns:
        the value
      • setValue

        public void setValue​(String value)
        Setter for the value property
        Parameters:
        value - the value
      • getLabel

        public String getLabel()
        Getter for the label property
        Returns:
        the label
      • setLabel

        public void setLabel​(String label)
        Setter for the label property
        Parameters:
        label - the label
      • setValueAndLabel

        public void setValueAndLabel​(String value,
                                     String label)
        Set both the value and label of the OptionItem
        Parameters:
        value - the value
        label - the label
      • setValueAndLabel

        public void setValueAndLabel​(String valueAndLabel)
        Set both the value and label of the OptionItem
        Parameters:
        valueAndLabel - both the label and value
      • getKey

        public String getKey()
        Description copied from interface: KeyObject
        Returns the key of the object
        Specified by:
        getKey in interface KeyObject<String>
        Returns:
        the key for this object