Package dev.boze.api.option
Class PageOption
- All Implemented Interfaces:
Serializable<Boolean>
A page option that serves as a container for organizing options into pages
PageOption extends ParentOption and provides page-based navigation
When a page is selected, only options belonging to that page are shown
-
Field Summary
Fields inherited from class dev.boze.api.option.Option
description, name, owner -
Constructor Summary
ConstructorsConstructorDescriptionPageOption(BaseModule owner, String name, String description) Creates a new page option -
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.google.gson.JsonObject object) booleanGets whether this page is currently selectedvoidsetSelected(boolean selected) Sets whether this page is currently selectedcom.google.gson.JsonObjecttoJson()Methods inherited from class dev.boze.api.option.ParentOption
getValue, reset, setValueMethods inherited from class dev.boze.api.option.Option
getFullName, getParent, isParent, setParent
-
Constructor Details
-
PageOption
Creates a new page option- Parameters:
owner- The module that owns this optionname- The name of this optiondescription- The description of this option
-
-
Method Details
-
isSelected
public boolean isSelected()Gets whether this page is currently selected- Returns:
- true if selected, false otherwise
-
setSelected
public void setSelected(boolean selected) Sets whether this page is currently selected- Parameters:
selected- true to select, false to deselect
-
toJson
public com.google.gson.JsonObject toJson()- Specified by:
toJsonin interfaceSerializable<Boolean>- Overrides:
toJsonin classParentOption- Returns:
- The object as a JsonObject
-
fromJson
- Specified by:
fromJsonin interfaceSerializable<Boolean>- Overrides:
fromJsonin classParentOption- Parameters:
object- The JsonObject to deserialize- Returns:
- The deserialized object
-