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 of StateRepository entirely on memory. This class is typically only used for integration tests or at development time.
Author:
Christian Kaltepoth
  • Constructor Details

    • InMemoryStateRepository

      public InMemoryStateRepository()
  • Method Details

    • getFeatureState

      public FeatureState getFeatureState(Feature feature)
      Description copied from interface: StateRepository
      Get the persisted state of a feature from the repository. If the repository doesn't contain any information regarding this feature it must return null.
      Specified by:
      getFeatureState in interface StateRepository
      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: StateRepository
      Persist the supplied feature state. The repository implementation must ensure that subsequent calls to StateRepository.getFeatureState(Feature) return the same state as persisted using this method.
      Specified by:
      setFeatureState in interface StateRepository
      Parameters:
      featureState - The feature state to persist