public class IsFeatureEnabledCondition extends AbstractFeatureCondition implements com.atlassian.plugin.web.Condition
Feature
is is enabled
.
This condition can be used with standard features
or custom features. When using a custom
feature, the provided "key"
is used to construct a SimpleFeature
. Feature.isDataCenter()
can
be set by including a "dataCenter"
parameter; it defaults to false
if it's not specified.
Whether using a StandardFeature
or not, it's also possible to specify a "defaultValue"
parameter to
define whether the feature should be considered enabled or disabled if it's not explicitly configured. The default
value is set to false
if the parameter is not provided.
featureManager
Modifier | Constructor and Description |
---|---|
|
IsFeatureEnabledCondition(com.atlassian.bitbucket.server.FeatureManager featureManager) |
protected |
IsFeatureEnabledCondition(com.atlassian.bitbucket.server.FeatureManager featureManager,
com.atlassian.bitbucket.server.Feature feature)
Instantiates a check used to determine whether the provided
feature is enabled. |
Modifier and Type | Method and Description |
---|---|
void |
init(Map<String,String> params) |
boolean |
shouldDisplay(Map<String,Object> context) |
getFeature
public IsFeatureEnabledCondition(com.atlassian.bitbucket.server.FeatureManager featureManager)
protected IsFeatureEnabledCondition(com.atlassian.bitbucket.server.FeatureManager featureManager, com.atlassian.bitbucket.server.Feature feature)
feature
is enabled. The specified
feature cannot be overridden by calling init(java.util.Map<java.lang.String, java.lang.String>)
.featureManager
- the feature manager to perform the checkfeature
- the feature to checkpublic void init(Map<String,String> params) throws com.atlassian.plugin.PluginParseException
init
in interface com.atlassian.plugin.web.Condition
init
in class AbstractFeatureCondition
com.atlassian.plugin.PluginParseException
Copyright © 2021 Atlassian. All rights reserved.