Package dev.boze.api.option
Class SliderOption
- All Implemented Interfaces:
Serializable<Double>
A numeric option that can be adjusted using a slider
SliderOption provides a way to store and modify numeric values within a specified range
The value is always clamped between min and max, and can only be set in increments of step
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
The maximum value this slider can be set tofinal double
The minimum value this slider can be set tofinal double
The increment by which this slider's value changesFields inherited from class dev.boze.api.option.Option
description, name, owner
-
Constructor Summary
ConstructorsConstructorDescriptionSliderOption
(AddonModule owner, String name, String description, double value, double min, double max, double step) Creates a new slider option -
Method Summary
-
Field Details
-
min
public final double minThe minimum value this slider can be set to -
max
public final double maxThe maximum value this slider can be set to -
step
public final double stepThe increment by which this slider's value changes
-
-
Constructor Details
-
SliderOption
public SliderOption(AddonModule owner, String name, String description, double value, double min, double max, double step) Creates a new slider option- Parameters:
owner
- The module that owns this optionname
- The name of this optiondescription
- The description of this optionvalue
- The initial valuemin
- The minimum allowed valuemax
- The maximum allowed valuestep
- The increment between values
-
-
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
-