Class InMemoryStorageService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<byte[]> getValue​(java.lang.String key)
      Returns the value associated with the given key.
      void removeValue​(java.lang.String key)
      Removes the entry with a given key.
      java.util.Optional<byte[]> setValue​(java.lang.String key, io.token.proto.bankapi.Bankapi.SetValueRequest.ContentCategory category, byte[] value)
      Sets the value for a given key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InMemoryStorageService

        public InMemoryStorageService()
    • Method Detail

      • getValue

        public java.util.Optional<byte[]> getValue​(java.lang.String key)
        Description copied from interface: StorageService
        Returns the value associated with the given key.
        Specified by:
        getValue in interface StorageService
        Parameters:
        key - the key
        Returns:
        the value
      • setValue

        public java.util.Optional<byte[]> setValue​(java.lang.String key,
                                                   io.token.proto.bankapi.Bankapi.SetValueRequest.ContentCategory category,
                                                   byte[] value)
        Description copied from interface: StorageService
        Sets the value for a given key. Over time, might be called more than once for the same key, setting a new value.
        Specified by:
        setValue in interface StorageService
        Parameters:
        key - the key
        category - content category, can be used to set up category-specific retention policies.
        value - the value to set
        Returns:
        previous value if present
      • removeValue

        public void removeValue​(java.lang.String key)
        Description copied from interface: StorageService
        Removes the entry with a given key.
        Specified by:
        removeValue in interface StorageService
        Parameters:
        key - the key