Class FeatureToggle


  • public final class FeatureToggle
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      FeatureToggle​(java.lang.String name, java.util.concurrent.atomic.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
      java.lang.String getName()  
      boolean isEnabled()  
      boolean setEnabled​(boolean state)
      Changes the state of the feature toggle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeatureToggle

        public FeatureToggle​(java.lang.String name,
                             java.util.concurrent.atomic.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 java.lang.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.