Class FeatureToggle


  • public final class FeatureToggle
    extends Object
    A feature toggle is registered with the Whiteboard and can be discovered by third party code to control the state of feature toggles.
    • 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.