com.atlassian.sal.api.features
Class EnabledDarkFeatures

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

@Immutable
public final class EnabledDarkFeatures
extends Object

Represents a set of enabled features.

Since:
2.10

Field Summary
static EnabledDarkFeatures NONE
          Shorthand in case there are no enabled dark features or they are disabled
 
Constructor Summary
EnabledDarkFeatures(com.google.common.collect.ImmutableMap<FeatureKeyScope,com.google.common.collect.ImmutableSet<String>> enabledFeatures)
          Create an instance of enabled features based on the given map.
 
Method Summary
 com.google.common.collect.ImmutableSet<String> getFeatureKeys()
          Return all enabled feature keys.
 com.google.common.collect.ImmutableSet<String> getFeatureKeys(com.google.common.base.Predicate<FeatureKeyScope> criteria)
          Returns all enabled feature keys matching the given criteria.
 boolean isFeatureEnabled(String featureKey)
          Check that the given feature is enabled
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

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

Constructor Detail

EnabledDarkFeatures

public EnabledDarkFeatures(com.google.common.collect.ImmutableMap<FeatureKeyScope,com.google.common.collect.ImmutableSet<String>> enabledFeatures)
Create an instance of enabled features based on the given map.

Parameters:
enabledFeatures - a map of enabled features
Method Detail

getFeatureKeys

public com.google.common.collect.ImmutableSet<String> getFeatureKeys()
Return all enabled feature keys.

Returns:
all enabled feature keys

getFeatureKeys

public com.google.common.collect.ImmutableSet<String> getFeatureKeys(com.google.common.base.Predicate<FeatureKeyScope> criteria)
Returns all enabled feature keys matching the given criteria.

Parameters:
criteria - the filter condition to be applied on the set of enabled features
Returns:
the filtered set of enabled features

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


Copyright © 2015 Atlassian. All rights reserved.