Package me.hackware.api.setting.impl
Class EnumSetting<E extends Enum<E>>
java.lang.Object
me.hackware.api.setting.Setting<E>
me.hackware.api.setting.ChoiceSetting<E>
me.hackware.api.setting.impl.EnumSetting<E>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEnumSetting(String name) EnumSetting(String name, E defaultValue) EnumSetting(String name, String description) EnumSetting(String name, String description, E defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionintNumber of selectable options.intIndex of the currently-selected option, or-1if none.choiceKey(int index) Stable persistence key for the option atindex(slugged by the config layer).choiceLabel(int index) Human-readable label for the option atindex.voidchoiceSelect(int index) Select the option atindex.voidcycle()defaultValue(E defaultValue) description(String description) displayName(String displayName) voidselectByIndex(int index) Select a value by its ordinal index within the enum's values list.visible(boolean visible) visible(BooleanSupplier visible) Methods inherited from class me.hackware.api.setting.ChoiceSetting
choiceCurrentLabel, choiceCycleMethods inherited from class me.hackware.api.setting.Setting
get, getDefaultValue, getDescription, getDisplayName, getGroup, getName, getOwner, isBulkLoading, isVisible, setBulkLoadProbe, setOwner, setValue
-
Constructor Details
-
EnumSetting
-
EnumSetting
-
EnumSetting
-
EnumSetting
-
-
Method Details
-
defaultValue
- Overrides:
defaultValuein classSetting<E extends Enum<E>>
-
displayName
- Overrides:
displayNamein classSetting<E extends Enum<E>>
-
description
- Overrides:
descriptionin classSetting<E extends Enum<E>>
-
group
-
visible
-
visible
-
onChanged
-
getEnumClass
-
getValues
-
cycle
public void cycle() -
selectByIndex
public void selectByIndex(int index) Select a value by its ordinal index within the enum's values list. -
choiceCount
public int choiceCount()Description copied from class:ChoiceSettingNumber of selectable options.- Specified by:
choiceCountin classChoiceSetting<E extends Enum<E>>
-
choiceLabel
Description copied from class:ChoiceSettingHuman-readable label for the option atindex.- Specified by:
choiceLabelin classChoiceSetting<E extends Enum<E>>
-
choiceKey
Description copied from class:ChoiceSettingStable persistence key for the option atindex(slugged by the config layer).- Specified by:
choiceKeyin classChoiceSetting<E extends Enum<E>>
-
choiceIndex
public int choiceIndex()Description copied from class:ChoiceSettingIndex of the currently-selected option, or-1if none.- Specified by:
choiceIndexin classChoiceSetting<E extends Enum<E>>
-
choiceSelect
public void choiceSelect(int index) Description copied from class:ChoiceSettingSelect the option atindex.- Specified by:
choiceSelectin classChoiceSetting<E extends Enum<E>>
-