public class MockFeatureManager extends Object implements FeatureManager
| Modifier and Type | Class and Description |
|---|---|
static class |
MockFeatureManager.AllDarkFeaturesDisabled |
SYSTEM_PROPERTY_PREFIX| Constructor and Description |
|---|
MockFeatureManager() |
| Modifier and Type | Method and Description |
|---|---|
MockFeatureManager |
activateFeatureFlag(FeatureFlag featureFlag) |
MockFeatureManager |
deactivateFeatureFlag(FeatureFlag featureFlag) |
MockFeatureManager |
disable(Feature feature)
Deprecated.
Use
disableFeature(Feature) instead |
MockFeatureManager |
disableFeature(CoreFeatures feature) |
MockFeatureManager |
disableFeature(Feature feature) |
MockFeatureManager |
disableFeature(FeatureFlag feature) |
void |
disableSiteDarkFeature(String feature)
Disables a site-wide feature.
|
void |
disableUserDarkFeature(ApplicationUser user,
String feature)
Disables a feature for a particular user.
|
void |
enable(CoreFeatures feature)
Deprecated.
Use
enableFeature(CoreFeatures) instead |
void |
enable(Feature feature)
Deprecated.
Use
enableFeature(Feature) instead |
MockFeatureManager |
enableFeature(CoreFeatures feature) |
MockFeatureManager |
enableFeature(Feature feature) |
MockFeatureManager |
enableFeature(FeatureFlag feature) |
void |
enableSiteDarkFeature(String feature)
Enables a site-wide feature.
|
void |
enableUserDarkFeature(ApplicationUser user,
String feature)
Enables a feature for a particular User.
|
DarkFeatures |
getDarkFeatures()
Creates
DarkFeatures instances from the PropertySet associated
with the current user. |
DarkFeatures |
getDarkFeaturesForUser(ApplicationUser user) |
Set<String> |
getEnabledFeatureKeys()
Returns a set containing the feature keys of all features that are currently enabled.
|
com.atlassian.fugue.Option<FeatureFlag> |
getFeatureFlag(String featureKey)
Return a feature flag by key
|
Set<FeatureFlag> |
getRegisteredFlags() |
boolean |
hasSiteEditPermission()
Returns true if the currently logged in user has permission to edit site dark features.
|
boolean |
isEnabled(CoreFeatures feature)
Checks whether
feature is enabled either in the running JIRA instance
or for the current user. |
boolean |
isEnabled(Feature feature)
Checks whether or not the specified feature is enabled.
|
boolean |
isEnabled(FeatureFlag featureFlag)
Checking the state of feature flag
|
boolean |
isEnabled(String featureKey)
Checks whether feature
featureKey is enabled either in the running JIRA instance
or for the current user. |
boolean |
isEnabledForUser(ApplicationUser user,
String featureKey)
Checks whether a feature with given featureKey is enabled in the running JIRA instance for the given user.
|
MockFeatureManager |
registerFeatureFlag(FeatureFlag feature) |
MockFeatureManager |
resetFeature(FeatureFlag feature) |
MockFeatureManager |
unregisterFeatureFlag(FeatureFlag feature) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisOnDemandpublic boolean isEnabled(String featureKey)
FeatureManagerfeatureKey is enabled either in the running JIRA instance
or for the current user.
If the featureKey relates to a feature flag that is defined, then it will also take the
default values into consideration.isEnabled in interface FeatureManagerfeatureKey - feature keytrue, if feature identified by featureKey is enabled, false otherwisepublic boolean isEnabled(Feature feature)
FeatureManagerFeatureManager.isEnabled(String) for internal feature checks,
particularly for core features that are not user-settable, as it will skip
loading the current user's preferences when possible.isEnabled in interface FeatureManagerfeature - the feature to checktrue if feature is enabled; false otherwisepublic boolean isEnabled(FeatureFlag featureFlag)
FeatureManagerisEnabled in interface FeatureManagerfeatureFlag - defined feature flagpublic com.atlassian.fugue.Option<FeatureFlag> getFeatureFlag(String featureKey)
FeatureManagergetFeatureFlag in interface FeatureManagerfeatureKey - the feature key stringpublic boolean isEnabled(CoreFeatures feature)
FeatureManagerfeature is enabled either in the running JIRA instance
or for the current user. This method should be prefered over
FeatureManager.isEnabled(String) for internal feature checks, particularly for
core features that are not user-settable, as it will skip loading the
current user's preferences when possible.isEnabled in interface FeatureManagerfeature - the core feature to checktrue if feature is enabled; false otherwise@Deprecated public void enable(CoreFeatures feature)
enableFeature(CoreFeatures) insteadpublic MockFeatureManager enableFeature(CoreFeatures feature)
public MockFeatureManager disableFeature(CoreFeatures feature)
@Deprecated public void enable(Feature feature)
enableFeature(Feature) insteadpublic MockFeatureManager enableFeature(Feature feature)
@Deprecated public MockFeatureManager disable(Feature feature)
disableFeature(Feature) insteadpublic MockFeatureManager disableFeature(Feature feature)
public MockFeatureManager enableFeature(FeatureFlag feature)
public MockFeatureManager disableFeature(FeatureFlag feature)
public MockFeatureManager resetFeature(FeatureFlag feature)
public MockFeatureManager registerFeatureFlag(FeatureFlag feature)
public MockFeatureManager unregisterFeatureFlag(FeatureFlag feature)
public MockFeatureManager activateFeatureFlag(FeatureFlag featureFlag)
public MockFeatureManager deactivateFeatureFlag(FeatureFlag featureFlag)
public Set<String> getEnabledFeatureKeys()
FeatureManagergetEnabledFeatureKeys in interface FeatureManagerpublic DarkFeatures getDarkFeatures()
FeatureManagerDarkFeatures instances from the PropertySet associated
with the current user.getDarkFeatures in interface FeatureManagerpublic Set<FeatureFlag> getRegisteredFlags()
getRegisteredFlags in interface FeatureManagerpublic void enableUserDarkFeature(ApplicationUser user, String feature)
FeatureManagerFeatureEnabledEvent.
Since JIRA 5.1, this method raises a FeatureEnabledEvent if it is successful.
enableUserDarkFeature in interface FeatureManageruser - the user to enable the feature forfeature - the feature to enablepublic void disableUserDarkFeature(ApplicationUser user, String feature)
FeatureManager
Since JIRA 5.1, this method raises a FeatureDisabledEvent if it is successful.
disableUserDarkFeature in interface FeatureManageruser - the user to disable the feature forfeature - the feature to disablepublic void enableSiteDarkFeature(String feature)
FeatureManager
Since JIRA 5.1, this method raises a FeatureEnabledEvent if it is successful.
enableSiteDarkFeature in interface FeatureManagerfeature - the feature to enablepublic void disableSiteDarkFeature(String feature)
FeatureManager
Since JIRA 5.1, this method raises a FeatureDisabledEvent if it is successful.
disableSiteDarkFeature in interface FeatureManagerfeature - the feature to disablepublic boolean hasSiteEditPermission()
FeatureManagerhasSiteEditPermission in interface FeatureManagerpublic DarkFeatures getDarkFeaturesForUser(@Nullable ApplicationUser user)
getDarkFeaturesForUser in interface FeatureManageruser - the user being queried; null represents the anonymous userpublic boolean isEnabledForUser(ApplicationUser user, String featureKey)
FeatureManagerisEnabledForUser in interface FeatureManageruser - the user being queriedfeatureKey - feature keytrue, if feature identified by featureKey is enabled, false otherwiseCopyright © 2002-2018 Atlassian. All Rights Reserved.