Class ParentOption

java.lang.Object
dev.boze.api.option.Option<Boolean>
dev.boze.api.option.ParentOption
All Implemented Interfaces:
Serializable<Boolean>
Direct Known Subclasses:
PageOption

public class ParentOption extends Option<Boolean>
An option that serves as a parent container for other options

ParentOption provides a way to group related options together

It doesn't store a meaningful value itself, but serves as a container for child options
  • Constructor Details

    • ParentOption

      public ParentOption(BaseModule owner, String name, String description)
      Creates a new parent option
      Parameters:
      owner - The module that owns this option
      name - The name of this option
      description - The description of this option
    • ParentOption

      public ParentOption(BaseModule owner, String name, String description, Option<?> parent)
      Creates a new parent option with a parent
      Parameters:
      owner - The module that owns this option
      name - The name of this option
      description - The description of this option
      parent - The parent option
  • Method Details

    • getValue

      public Boolean getValue()
      Description copied from class: Option
      Gets the current value of this option
      Specified by:
      getValue in class Option<Boolean>
      Returns:
      The current value
    • setValue

      public Boolean setValue(Boolean newValue)
      Description copied from class: Option
      Sets the value of this option
      Specified by:
      setValue in class Option<Boolean>
      Parameters:
      newValue - The new value to set
      Returns:
      The value that was set (may be different from newValue if validation was performed)
    • reset

      public Boolean reset()
      Description copied from class: Option
      Resets this option to its default value
      Specified by:
      reset in class Option<Boolean>
      Returns:
      The default value
    • toJson

      public com.google.gson.JsonObject toJson()
      Returns:
      The object as a JsonObject
    • fromJson

      public Boolean fromJson(com.google.gson.JsonObject object)
      Parameters:
      object - The JsonObject to deserialize
      Returns:
      The deserialized object