Class EnabledDarkFeatures

java.lang.Object
com.atlassian.sal.api.features.EnabledDarkFeatures

@Immutable @PublicApi public final class EnabledDarkFeatures extends Object
Represents a set of enabled features.
Since:
2.10
  • Field Details

    • NONE

      public static final EnabledDarkFeatures NONE
      Shorthand in case there are no enabled dark features, or they are disabled
  • Constructor Details

    • EnabledDarkFeatures

      public EnabledDarkFeatures(Map<FeatureKeyScope,Set<String>> enabledFeatures)
      Create an instance of enabled features based on the given map.
      Parameters:
      enabledFeatures - a map of enabled features
      Since:
      4.6.0
  • Method Details

    • getFeatureKeySet

      public Set<String> getFeatureKeySet()
      Return all enabled feature keys, the set will be immutable.
      Returns:
      all enabled feature keys
      Since:
      4.6.0
    • getFeatureKeys

      public Set<String> getFeatureKeys(Predicate<FeatureKeyScope> criteria)
      Returns all enabled feature keys matching the given criteria. The set returned will be unmodifiable.
      Parameters:
      criteria - the filter condition to be applied on the set of enabled features
      Returns:
      the filtered set of enabled features
      Since:
      4.6.0
    • isFeatureEnabled

      public boolean isFeatureEnabled(String featureKey)
      Check that the given feature is enabled
      Parameters:
      featureKey - the feature key to be checked
      Returns:
      true if the given feature key is enabled, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object