Class EnumSetting<E extends Enum<E>>


  • public abstract class EnumSetting<E extends Enum<E>>
    extends Setting
    Represents a setting with a current value amongst a valid set of choices.
    • Constructor Detail

      • EnumSetting

        public EnumSetting()
    • Method Detail

      • getValue

        @NonNull
        public abstract E getValue()
        Retrieves the current setting value.

        Return value should be considered meaningless in case the set of available values is empty.

        Returns:
        current setting value
      • setValue

        public abstract void setValue​(@NonNull
                                      E value)
        Sets the current setting value.

        The provided value must be present in the set of available values, otherwise this method does nothing.

        Parameters:
        value - setting value to set
      • getAvailableValues

        @NonNull
        public abstract EnumSet<E> getAvailableValues()
        Retrieves the set of available choices for the setting.

        An empty set means that the whole setting is currently unsupported.
        A set containing a single value means that the setting is supported, yet not mutable by the application.

        The returned set is owned by the caller and can be freely modified.

        Returns:
        the set of available values that are currently applicable to this setting