Class FeatureFlagDefinitions

java.lang.Object
com.atlassian.jira.config.FeatureFlagDefinitions

public class FeatureFlagDefinitions extends Object
A FeatureFlagDefinitions is designed to be used in a static variable declaration while still capturing the flags defined via it.

Declare a static of this type and then declare specific FeatureFlag definitions as static variables as well.

 

 public class WellKnownFeatureFlags
 {
    static FeatureFlagDefinitions FLAGS = new FeatureFlagDefinitions();

    public final static FeatureFlag TEST_FEATURE_ONE = FLAGS.featureFlag("test.feature.one").define();

    public final static FeatureFlag TEST_FEATURE_TWO = FLAGS.featureFlag("test.feature.two").onByDefault().define();
 }
 
 
Since:
7.1
  • Constructor Details

    • FeatureFlagDefinitions

      public FeatureFlagDefinitions()
  • Method Details

    • getFeatureFlags

      public Set<FeatureFlag> getFeatureFlags()
      Returns:
      the set of feature flags defined by this object
    • featureFlag

      public FeatureFlagDefinitions.Definition featureFlag(String featureKey)
      Begin a new feature flag definition that can be stored in a static variable. It must follow the validation rules of this class
      Parameters:
      featureKey - the key of the feature
      Returns:
      an intermediary builder object that can be called on to finish the registration