Class EnumSetting<T extends Enum<T>>

  • All Implemented Interfaces:
    Setting<T>

    public class EnumSetting<T extends Enum<T>>
    extends Object
    implements Setting<T>
    A Setting of Enum type, see Setting

    • Constructor Detail

      • EnumSetting

        public EnumSetting​(String name,
                           Class<T> enumType,
                           T defaultValue)
    • Method Detail

      • getFrom

        public DynamicEnumProperty<T> getFrom​(DynamicConfig config)
        Description copied from interface: Setting
        Reads this Setting from the given DynamicConfig instance. If the DynamicConfig instance does not hold a value for this Setting, then the default value will be returned.
        Specified by:
        getFrom in interface Setting<T extends Enum<T>>
        Parameters:
        config - DynamicConfig instance to read this setting from
        Returns:
        This value of this setting in the given DynamicConfig instance, or the default value if the DynamicConfig instance does not contain a value for this Setting
      • name

        public String name()
        Description copied from interface: Setting
        The name of this Setting. Used when reading this Setting from a DynamicConfig instance.

        Specified by:
        name in interface Setting<T extends Enum<T>>
      • defaultValue

        public T defaultValue()
        Description copied from interface: Setting
        The default value for this setting. For settings of primitive types this method returns the boxed version of the given type, and never returns null.
        Specified by:
        defaultValue in interface Setting<T extends Enum<T>>