Class FeatureToggle
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.toggle.FeatureToggle
-
public final class FeatureToggle extends Object
A feature toggle is registered with theWhiteboard
and can be discovered by third party code to control the state of feature toggles.
-
-
Constructor Summary
Constructors Constructor Description FeatureToggle(String name, AtomicBoolean state)
Create a new adapter with a given name and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
boolean
isEnabled()
boolean
setEnabled(boolean state)
Changes the state of the feature toggle.
-
-
-
Constructor Detail
-
FeatureToggle
public FeatureToggle(String name, AtomicBoolean state)
Create a new adapter with a given name and value.- Parameters:
name
- the name of the feature toggle.state
- the state for the feature toggle.
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name of the feature toggle.
-
isEnabled
public boolean isEnabled()
- Returns:
- the current state of this feature toggle.
-
setEnabled
public boolean setEnabled(boolean state)
Changes the state of the feature toggle.- Parameters:
state
- the new state of the feature toggle.- Returns:
- the previous state.
-
-