@Internal public class AnalyticsAwareFeatureFlag extends FeatureFlag
FeatureFlag
that makes Feature Flag
analytics compatible. It means that with safeFeatureKey property it is possible to declare that feature key
should be hashed or can be passed as it is. Default behaviour is to hash all feature keys.
If you don't know what analytics are or if you are not sure if your feature key is safe, then you don't want to use this class.
This class is useful only when used together with FeatureFlagProvider
. If you use this class outside of implementation
of FeatureFlagProvider
it will have no effect = class will be working as normal implementation of FeatureFlag
.
POSTFIX_DISABLED, POSTFIX_ENABLED
Modifier and Type | Method and Description |
---|---|
static AnalyticsAwareFeatureFlag |
convertToAnalyticsAware(FeatureFlag featureFlag)
Creates a new FeatureFlag with the data from original feature key if FeatureFlag is not instance of
AnalyticsAwareFeatureFlag or returns flag itself otherwise |
static AnalyticsAwareFeatureFlag |
convertToSafeFeatureFlag(FeatureFlag featureFlag)
Creates a new FeatureFlag with the data from original feature key and set as safe for analytics
|
static FeatureFlag |
convertToUnsafeFeatureFlag(FeatureFlag featureFlag)
Creates a new FeatureFlag with the data from original feature key and set as unsafe for analytics
|
boolean |
equals(Object o) |
static AnalyticsAwareFeatureFlag |
featureFlag(String featureKey)
Creates a new FeatureFlag with the specified key and off by default and set as unsafe for analytics
|
String |
getSafeFeatureKey() |
int |
hashCode() |
boolean |
isSafeFlagForAnalytics() |
static AnalyticsAwareFeatureFlag |
safeFeatureFlag(String featureKey)
Creates a new FeatureFlag with the specified key and off by default and set as safe for analytics
|
AnalyticsAwareFeatureFlag |
safeKey()
Creates a new FeatureFlag that is set as safe for analytics
|
AnalyticsAwareFeatureFlag |
unsafeKey()
Creates a new FeatureFlag that is set as unsafe for analytics
|
defaultedTo, disabledFeatureKey, enabledFeatureKey, featureKey, isOnByDefault, offByDefault, onByDefault, toString
public boolean isSafeFlagForAnalytics()
public String getSafeFeatureKey()
public AnalyticsAwareFeatureFlag safeKey()
public AnalyticsAwareFeatureFlag unsafeKey()
public boolean equals(Object o)
equals
in class FeatureFlag
public int hashCode()
hashCode
in class FeatureFlag
public static AnalyticsAwareFeatureFlag featureFlag(String featureKey)
featureKey
- the key in playpublic static AnalyticsAwareFeatureFlag safeFeatureFlag(String featureKey)
featureKey
- the key in playpublic static AnalyticsAwareFeatureFlag convertToSafeFeatureFlag(FeatureFlag featureFlag)
featureFlag
- the flag in playpublic static FeatureFlag convertToUnsafeFeatureFlag(FeatureFlag featureFlag)
featureFlag
- the flag in playpublic static AnalyticsAwareFeatureFlag convertToAnalyticsAware(FeatureFlag featureFlag)
AnalyticsAwareFeatureFlag
or returns flag itself otherwisefeatureFlag
- feature flag to convertAnalyticsAwareFeatureFlag
if the same settings as provided feature flagCopyright © 2002-2024 Atlassian. All Rights Reserved.