Package org.togglz.core.repository.mem
Class InMemoryStateRepository
- java.lang.Object
-
- org.togglz.core.repository.mem.InMemoryStateRepository
-
- All Implemented Interfaces:
StateRepository
public class InMemoryStateRepository extends Object implements StateRepository
A very simply implementation ofStateRepositoryentirely on memory. This class is typically only used for integration tests or at development time.- Author:
- Christian Kaltepoth
-
-
Constructor Summary
Constructors Constructor Description InMemoryStateRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureStategetFeatureState(Feature feature)Get the persisted state of a feature from the repository.voidsetFeatureState(FeatureState featureState)Persist the supplied feature state.
-
-
-
Method Detail
-
getFeatureState
public FeatureState getFeatureState(Feature feature)
Description copied from interface:StateRepositoryGet the persisted state of a feature from the repository. If the repository doesn't contain any information regarding this feature it must returnnull.- Specified by:
getFeatureStatein interfaceStateRepository- Parameters:
feature- The feature to read the state for- Returns:
- The persisted feature state or
null
-
setFeatureState
public void setFeatureState(FeatureState featureState)
Description copied from interface:StateRepositoryPersist the supplied feature state. The repository implementation must ensure that subsequent calls toStateRepository.getFeatureState(Feature)return the same state as persisted using this method.- Specified by:
setFeatureStatein interfaceStateRepository- Parameters:
featureState- The feature state to persist
-
-