Package org.togglz.core.repository.mem
Class InMemoryStateRepository
java.lang.Object
org.togglz.core.repository.mem.InMemoryStateRepository
- All Implemented Interfaces:
StateRepository
A very simply implementation of
StateRepository entirely on memory. This class is typically only used for
integration tests or at development time.- Author:
- Christian Kaltepoth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFeatureState(Feature feature) Get the persisted state of a feature from the repository.voidsetFeatureState(FeatureState featureState) Persist the supplied feature state.
-
Constructor Details
-
InMemoryStateRepository
public InMemoryStateRepository()
-
-
Method Details
-
getFeatureState
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
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
-