Class FeatureFlag

java.lang.Object
com.atlassian.jira.config.FeatureFlag
All Implemented Interfaces:
Feature
Direct Known Subclasses:
AnalyticsAwareFeatureFlag

public class FeatureFlag extends Object implements Feature
A FeatureFlag is a simple declaration of a key and whether the flag is considered on or off by default. The FeatureFlag is different from a Feature because it can have a default value. Additionally, feature flags can be declared via xml and shared across apps.
Since:
7.1
  • Field Details

  • Method Details

    • featureKey

      public String featureKey()
      Description copied from interface: Feature
      The feature key that can be used to enable, disable or query the status of a feature using the FeatureManager.
      Specified by:
      featureKey in interface Feature
      Returns:
      feature key
    • isOnByDefault

      public boolean isOnByDefault()
      Returns:
      true if this feature is on by default
    • enabledFeatureKey

      public String enabledFeatureKey()
      Returns:
      this feature key with the enabled postfix of POSTFIX_ENABLED
    • disabledFeatureKey

      public String disabledFeatureKey()
      Returns:
      this feature key with the enabled postfix of POSTFIX_DISABLED
    • featureFlag

      public static FeatureFlag featureFlag(String featureKey)
      Creates a new FeatureFlag with the specified key and off by default
      Parameters:
      featureKey - the key in play
      Returns:
      a new feature flag
    • onByDefault

      public FeatureFlag onByDefault()
      Creates a new FeatureFlag that is on by default
      Returns:
      a new feature flag
    • offByDefault

      @Deprecated public FeatureFlag offByDefault()
      Deprecated.
      - since 7.6 all flags are created as off by default, if you want your flag to be switched on use onByDefault
      Creates a new FeatureFlag that is off by default
      Returns:
      a new feature flag
    • defaultedTo

      @Deprecated public FeatureFlag defaultedTo(boolean defaultValue)
      Deprecated.
      - since 7.6 all flags are created as off by default
      Creates a new FeatureFlag that is defaulted to the specified value
      Returns:
      a new feature flag
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object