Class EnumSetSetting<E extends Enum<E>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnumSetSetting.Builder<E extends Enum<E>>Builds anEnumSetSetting; empty by default.Nested classes/interfaces inherited from class Setting
Setting.Layer -
Field Summary
Fields inherited from class Setting
defaultValue, description, id, name, value -
Constructor Summary
ConstructorsConstructorDescriptionEnumSetSetting(String name, @Nullable String description, Class<E> type, Set<E> defaultValue, @Nullable Supplier<Boolean> visible) A setting as itsEnumSetSetting.Buildermakes it; get one fromSettingGroup.enumSet(String, Class), or call this from a subclass. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddseto the player's set.booleanWhethereis in the set in effect.Copy a value so the default is never mutated.voidfromJson(com.google.gson.JsonElement json) Load from JSON; invalid input must leave the value unchanged rather than throw.booleanSets the player's value from what a player typed (a command, a text box).voidRemovesefrom the player's set.Completions for command input; none by default.voidAddseto the player's set, or removes it if it's there.com.google.gson.JsonElementtoJson()The player's value as JSON, for config and shares.type()The enum the constants come from.E[]values()Every constant of the enum, in declaration order; a new array each call.The value in effect for people, the waySetting.parse(String)reads it back where it can.Methods inherited from class Setting
changed, decode, decode, defaultValue, description, edit, editsTakeEffect, encode, get, group, id, isDefault, isOverridden, isProtected, isSerializable, isVisible, name, onChanged, overriddenBy, override, override, playerValue, release, reset, set, setGlobalChangeHook, validate
-
Constructor Details
-
EnumSetSetting
public EnumSetSetting(String name, @Nullable String description, Class<E> type, Set<E> defaultValue, @Nullable Supplier<Boolean> visible) A setting as itsEnumSetSetting.Buildermakes it; get one fromSettingGroup.enumSet(String, Class), or call this from a subclass.
-
-
Method Details
-
type
-
values
Every constant of the enum, in declaration order; a new array each call. -
contains
Whethereis in the set in effect. -
toggle
Addseto the player's set, or removes it if it's there. -
add
Addseto the player's set. -
remove
Removesefrom the player's set. -
copy
-
toJson
-
fromJson
-
parse
-
suggestions
-
valueString
Description copied from class:SettingThe value in effect for people, the waySetting.parse(String)reads it back where it can.
-