Package dev.boze.api.option
Class ToggleOption
- All Implemented Interfaces:
Serializable<Boolean>
A boolean option that can be toggled on or off
ToggleOption provides a simple way to store and modify boolean values
The value can only be true or false
-
Field Summary
Fields inherited from class dev.boze.api.option.Option
description, name, owner
-
Constructor Summary
ConstructorsConstructorDescriptionToggleOption
(AddonModule owner, String name, String description) Creates a new toggle option with a default value of falseToggleOption
(AddonModule owner, String name, String description, boolean value) Creates a new toggle option with a specified default value -
Method Summary
-
Constructor Details
-
ToggleOption
Creates a new toggle option with a default value of false- Parameters:
owner
- The module that owns this optionname
- The name of this optiondescription
- The description of this option
-
ToggleOption
Creates a new toggle option with a specified default value- Parameters:
owner
- The module that owns this optionname
- The name of this optiondescription
- The description of this optionvalue
- The initial value
-
-
Method Details
-
getValue
Description copied from class:Option
Gets the current value of this option -
setValue
Description copied from class:Option
Sets the value of this option -
reset
Description copied from class:Option
Resets this option to its default value -
toJson
public com.google.gson.JsonObject toJson()- Returns:
- The object as a JsonObject
-
fromJson
- Parameters:
object
- The JsonObject to deserialize- Returns:
- The deserialized object
-