public class FeatureState extends Object implements Serializable
StateRepository implementations.| Constructor and Description |
|---|
FeatureState(Feature feature)
This constructor creates a new feature state for the given feature.
|
FeatureState(Feature feature,
boolean enabled)
This constructor creates a new feature state for the given feature.
|
FeatureState(Feature feature,
boolean enabled,
List<String> users)
Deprecated.
This constructor will be removed soon. You should use
FeatureState(Feature, boolean) and
setParameter(String, String) instead. |
| Modifier and Type | Method and Description |
|---|---|
FeatureState |
addUser(String user)
Deprecated.
This method will be removed soon. Use
setParameter(String, String) instead to modify the
corresponding strategy parameter. |
FeatureState |
addUsers(Collection<String> users)
Deprecated.
This method will be removed soon. Use
setParameter(String, String) instead to modify the
corresponding strategy parameter. |
FeatureState |
copy()
Creates a copy of this state object
|
static FeatureState |
copyOf(FeatureState featureState)
Returns a copy of a featureState, or
null if the featureState is
null. |
FeatureState |
disable()
Disable the feature
|
FeatureState |
enable()
Enable the feature
|
Feature |
getFeature()
Returns the feature represented by this feature state.
|
String |
getParameter(String name)
Returns the value of the given parameter.
|
Map<String,String> |
getParameterMap()
Returns an unmodifiable map of parameters
|
Set<String> |
getParameterNames()
Returns a list of all parameter names stored in the
FeatureState instance. |
String |
getStrategyId()
Returns the ID of the selected activation strategy.
|
List<String> |
getUsers()
Deprecated.
This method will be removed soon. Use
getParameter(String) instead to read the corresponding
strategy parameter. |
boolean |
isEnabled()
Whether this feature is enabled or not.
|
FeatureState |
setEnabled(boolean enabled)
Enables or disables the feature.
|
FeatureState |
setParameter(String name,
String value)
Sets a new value for the given parameter.
|
FeatureState |
setStrategyId(String strategyId)
Sets the selected activation strategy ID
|
public FeatureState(Feature feature)
feature - The feature that is represented by this state.public FeatureState(Feature feature, boolean enabled)
feature - The feature that is represented by this state.enabled - boolean indicating whether this feature should be enabled or not.@Deprecated public FeatureState(Feature feature, boolean enabled, List<String> users)
FeatureState(Feature, boolean) and
setParameter(String, String) instead.UsernameActivationStrategy.feature - The feature that is represented by this state.enabled - boolean indicating whether this feature should be enabled or not.users - A list of userspublic FeatureState copy()
public Feature getFeature()
nullpublic boolean isEnabled()
public FeatureState setEnabled(boolean enabled)
public FeatureState enable()
public FeatureState disable()
@Deprecated public List<String> getUsers()
getParameter(String) instead to read the corresponding
strategy parameter.null@Deprecated public FeatureState addUser(String user)
setParameter(String, String) instead to modify the
corresponding strategy parameter.@Deprecated public FeatureState addUsers(Collection<String> users)
setParameter(String, String) instead to modify the
corresponding strategy parameter.public String getStrategyId()
public FeatureState setStrategyId(String strategyId)
public String getParameter(String name)
null.public FeatureState setParameter(String name, String value)
public Set<String> getParameterNames()
FeatureState instance.public Map<String,String> getParameterMap()
public static FeatureState copyOf(FeatureState featureState)
null if the featureState is
null.Copyright © 2018. All Rights Reserved.