Package dev.boze.api.option
Class ModeOption<T extends Enum<T>>
java.lang.Object
dev.boze.api.option.Option<T>
dev.boze.api.option.ModeOption<T>
- Type Parameters:
- T- The enum type defining the available modes
- All Implemented Interfaces:
- Serializable<T>
An option for selecting from a predefined set of modes
 
 ModeOption provides a way to store and modify enum values
 
 The available modes are defined by the enum type parameter
- 
Field SummaryFields inherited from class dev.boze.api.option.Optiondescription, name, owner
- 
Constructor SummaryConstructorsConstructorDescriptionModeOption(BaseModule owner, String name, String description, T defaultValue) Creates a new mode optionModeOption(BaseModule owner, String name, String description, T defaultValue, Option<?> parent) Creates a new mode option with a parent
- 
Method SummaryModifier and TypeMethodDescriptionfromJson(com.google.gson.JsonObject object) Gets the enum class of this mode optionGets the name of the current modegetModes()Gets a list of all available mode namesgetValue()Gets the current value of this optionGets the name of the current valuereset()Resets this option to its default valueSets the value of this optionvoidsetValueByName(String name) Sets the current mode by namecom.google.gson.JsonObjecttoJson()Methods inherited from class dev.boze.api.option.OptiongetFullName, getParent, isParent, setParent
- 
Constructor Details- 
ModeOptionCreates a new mode option- Parameters:
- owner- The module that owns this option
- name- The name of this option
- description- The description of this option
- defaultValue- The initial value and default value
 
- 
ModeOptionpublic ModeOption(BaseModule owner, String name, String description, T defaultValue, Option<?> parent) Creates a new mode option with a parent- Parameters:
- owner- The module that owns this option
- name- The name of this option
- description- The description of this option
- defaultValue- The initial value and default value
- parent- The parent option, or null if this is a root option
 
 
- 
- 
Method Details- 
getEnumClassGets the enum class of this mode option- Returns:
- The enum class
 
- 
getModesGets a list of all available mode names- Returns:
- List of mode names
 
- 
getModeNameGets the name of the current mode- Returns:
- The current mode name
 
- 
getValueNameGets the name of the current value- Returns:
- The current value name
 
- 
getValueDescription copied from class:OptionGets the current value of this option
- 
setValueDescription copied from class:OptionSets the value of this option
- 
resetDescription copied from class:OptionResets this option to its default value
- 
setValueByNameSets the current mode by nameThe name is case-insensitive - Parameters:
- name- The name of the mode to set
 
- 
toJsonpublic com.google.gson.JsonObject toJson()- Returns:
- The object as a JsonObject
 
- 
fromJson- Parameters:
- object- The JsonObject to deserialize
- Returns:
- The deserialized object
 
 
-