public class PropertyBasedStateRepository extends Object implements StateRepository
StateRepository stores the state of features in a Properties format.
The properties are managed through an implementation of PropertySource to manage the actual source
of the property values.
The file format has changed since version 2.0.0 because of the new extendible activation strategy support. Old file formats will be automatically migrated. The new format looks like this:
FEATURE_ONE = true FEATURE_ONE.strategy = gradual FEATURE_ONE.param.percentage = 25 FEATURE_TWO = false
A feature is enabled if the value is one of true, yes, enable, or enabled; any other
value and the feature is considered disabled.
| Constructor and Description |
|---|
PropertyBasedStateRepository(PropertySource propertySource) |
| Modifier and Type | Method and Description |
|---|---|
FeatureState |
getFeatureState(Feature feature)
Get the persisted state of a feature from the repository.
|
void |
setFeatureState(FeatureState featureState)
Persist the supplied feature state.
|
public PropertyBasedStateRepository(PropertySource propertySource)
public FeatureState getFeatureState(Feature feature)
StateRepositorynull.getFeatureState in interface StateRepositoryfeature - The feature to read the state fornullpublic void setFeatureState(FeatureState featureState)
StateRepositoryStateRepository.getFeatureState(Feature) return the same state as persisted using this method.setFeatureState in interface StateRepositoryfeatureState - The feature state to persistCopyright © 2018. All Rights Reserved.