public class MapStore extends Object implements KeyValueStore
Constructor and Description |
---|
MapStore()
Private constructor for the singleton pattern.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the store.
|
String |
get(String key)
Get the value for a key from store.
|
boolean |
isHealthy()
Get the health status of the store.
|
boolean |
isOpen()
Get the open / closed status of the store.
|
void |
open()
Open the store.
|
String |
put(String key,
String value)
Set a value for the key.
|
Map<String,String> |
putAll(Map<String,String> entries)
Set a multiple key/value pairs.
|
String |
remove(String key)
Remove a key from store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrDefault, replaceStore
public void open()
KeyValueStore
open
in interface KeyValueStore
public void close()
KeyValueStore
close
in interface KeyValueStore
close
in interface Closeable
close
in interface AutoCloseable
public boolean isOpen()
KeyValueStore
isOpen
in interface KeyValueStore
public String remove(@NotNull String key)
KeyValueStore
remove
in interface KeyValueStore
key
- Key to removepublic String get(@NotNull String key)
KeyValueStore
get
in interface KeyValueStore
key
- Key to get the value forpublic boolean isHealthy()
KeyValueStore
isHealthy
in interface KeyValueStore
public String put(@NotNull String key, String value)
KeyValueStore
Also removes the key if the value is null.
put
in interface KeyValueStore
key
- Key to setvalue
- Value to set for the given keypublic Map<String,String> putAll(@NotNull Map<String,String> entries)
KeyValueStore
Removes any keys with a null value.
putAll
in interface KeyValueStore
entries
- Map of key/value pairs to putCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.