Package org.apache.sling.feature.extension.apiregions.api.config

# Class Option

java.lang.Object
org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity
org.apache.sling.feature.extension.apiregions.api.config.DescribableEntity
org.apache.sling.feature.extension.apiregions.api.config.Option

public class Option extends DescribableEntity
Option for a property value This class is not thread safe.

## Constructor Summary

Constructors
Constructor
Description
`Option()`

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Clear the object and reset to defaults
`protected jakarta.json.JsonObjectBuilder`
`createJson()`
Convert this object into JSON
`void`
`fromJSONObject(jakarta.json.JsonObject jsonObj)`
Extract the metadata from the JSON object.
`String`
`getValue()`
Get the value for the option
`void`
`setValue(String value)`
Set the value for the option

### Methods inherited from class org.apache.sling.feature.extension.apiregions.api.config.DescribableEntity

`getDeprecated, getDescription, getEnforceOn, getSince, getTitle, setDeprecated, setDescription, setEnforceOn, setSince, setTitle`

### Methods inherited from class org.apache.sling.feature.extension.apiregions.api.config.AttributeableEntity

`getAttributes, getBoolean, getInteger, getNumber, getString, getString, getStringArray, setDefaults, setString, setStringArray, toJSONObject`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Option

public Option()

## Method Details

### clear

public void clear()
Clear the object and reset to defaults

Overrides:
  `clear` in class `DescribableEntity`

### fromJSONObject

public void fromJSONObject(jakarta.json.JsonObject jsonObj) throws IOException
Extract the metadata from the JSON object. This method first calls `clear()`

Overrides:
  `fromJSONObject` in class `DescribableEntity`
Parameters:
  `jsonObj` - The JSON Object
Throws:
  `IOException` - If JSON parsing fails

### getValue

public String getValue()
Get the value for the option

Returns:
  the value or `null`

### setValue

public void setValue(String value)
Set the value for the option

Parameters:
  `value` - the value to set

### createJson

protected jakarta.json.JsonObjectBuilder createJson() throws IOException
Convert this object into JSON

Overrides:
  `createJson` in class `DescribableEntity`
Returns:
  The json object builder
Throws:
  `IOException` - If generating the JSON fails