Class InMemoryStorage

java.lang.Object
org.eolang.opeo.storage.InMemoryStorage
All Implemented Interfaces:
Storage

public final class InMemoryStorage extends Object implements Storage
Storage that keeps everything in memory. This storage is rather useful for unit tests.
Since:
0.2
  • Constructor Details

    • InMemoryStorage

      public InMemoryStorage()
      Constructor.
    • InMemoryStorage

      public InMemoryStorage(List<XmirEntry> container)
      Constructor.
      Parameters:
      container - Container where everything is stored.
  • Method Details

    • all

      public Stream<XmirEntry> all()
      Description copied from interface: Storage
      Get all XMIRs.
      Specified by:
      all in interface Storage
      Returns:
      All XMIRs
    • save

      public void save(XmirEntry xmir)
      Description copied from interface: Storage
      Save XMIR.
      Specified by:
      save in interface Storage
      Parameters:
      xmir - XMIR to save
    • last

      public XmirEntry last()
      Get the last saved entry.
      Returns:
      The last saved entry.