Package ru.ewc.decita

Class InMemoryStorage

java.lang.Object
ru.ewc.decita.InMemoryStorage
All Implemented Interfaces:
Locator

public final class InMemoryStorage extends Object implements Locator
I am a simple in-memory key-value storage. My main responsibility is to store and return the specified data for testing purposes.
Since:
0.2
  • Constructor Details

    • InMemoryStorage

      public InMemoryStorage(Map<String,Object> storage)
      Ctor.
      Parameters:
      storage - The pre-filled key-value storage to start with.
  • Method Details

    • fragmentBy

      public String fragmentBy(String fragment, ComputationContext context)
      Description copied from interface: Locator
      Determines the system's state - the value of a single property, described by its name.
      Specified by:
      fragmentBy in interface Locator
      Parameters:
      fragment - The String identifier of the required property.
      context - The ComputationContext to use in property retrieval.
      Returns:
      The value of the requested property as a String.