public class DefaultValueStore extends Object implements ValueStore
ValueStore.
Simply uses Map as underlying storage.
Primitive values will be autoboxed to corresponding wrapper values when they
are stored.
| Constructor and Description |
|---|
DefaultValueStore() |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object key)
Get the value associated to the key.
|
<T> T |
get(Object key,
Class<T> type)
Get the value associated to the key and cast to the type.
|
<T> T |
getOrDefault(Object key,
T defaultValue)
Get the value associated to the key; otherwise returns specified value.
|
void |
put(Object key,
Object value)
Store a value associating the provided key.
|
void |
putAll(Map<Object,Object> map)
Store all key value pairs from provided map.
|
Object |
remove(Object key)
Remove the value associated to the provided key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic Object get(Object key)
ValueStoreget in interface ValueStorekey - keynullpublic <T> T get(Object key, Class<T> type)
ValueStoreget in interface ValueStoreT - value typekey - keytype - value type to castnullpublic <T> T getOrDefault(Object key, T defaultValue)
ValueStoregetOrDefault in interface ValueStoreT - value typekey - keydefaultValue - default valuepublic void put(Object key, Object value)
ValueStoreput in interface ValueStorekey - keyvalue - valuepublic void putAll(Map<Object,Object> map)
ValueStoreputAll in interface ValueStoremap - mappublic Object remove(Object key)
ValueStoreremove in interface ValueStorekey - keynull if key did not existCopyright © 2025. All rights reserved.