Class InMemoryKeyValueClient
java.lang.Object
io.fluxcapacitor.javaclient.persisting.keyvalue.client.InMemoryKeyValueClient
- All Implemented Interfaces:
KeyValueClient,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()deleteValue(String key) Deletes the value associated with the given key.Data<byte[]>Returns theDataobject associated with the given key.Adds or replaces the given value in the key value store.putValueIfAbsent(String key, Data<byte[]> value) Adds the given value in the key value store if the key is not already mapped to a value.
-
Constructor Details
-
InMemoryKeyValueClient
public InMemoryKeyValueClient() -
InMemoryKeyValueClient
-
-
Method Details
-
putValue
Description copied from interface:KeyValueClientAdds or replaces the given value in the key value store.- Specified by:
putValuein interfaceKeyValueClient- Parameters:
key- The key associated with this valuevalue- The value to storeguarantee- The guarantee for storing- Returns:
- a handle that enables clients to wait until the value was sent or stored depending on the guarantee
-
putValueIfAbsent
Description copied from interface:KeyValueClientAdds the given value in the key value store if the key is not already mapped to a value.- Specified by:
putValueIfAbsentin interfaceKeyValueClient- Parameters:
key- The key associated with this valuevalue- The value to store- Returns:
- a handle that enables clients to wait until the value was sent or stored depending on the guarantee
-
getValue
Description copied from interface:KeyValueClientReturns theDataobject associated with the given key. Returnsnullif there is no associated value.- Specified by:
getValuein interfaceKeyValueClient- Parameters:
key- The key associated with the value- Returns:
- the value for the given key or null
-
deleteValue
Description copied from interface:KeyValueClientDeletes the value associated with the given key.- Specified by:
deleteValuein interfaceKeyValueClient- Parameters:
key- The key associated with this value- Returns:
- a handle that enables clients to wait until the command was safely sent to the store
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceKeyValueClient
-