Class DefaultValueStore
java.lang.Object
io.r2dbc.proxy.core.DefaultValueStore
- All Implemented Interfaces:
ValueStore
Default implementation of
ValueStore.
Simply uses Map as underlying storage.
Primitive values will be autoboxed to corresponding wrapper values when they
are stored.
- Author:
- Tadaya Tsuyukubo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the value associated to the key.<T> TGet the value associated to the key and cast to the type.<T> TgetOrDefault(Object key, T defaultValue) Get the value associated to the key; otherwise returns specified value.voidStore a value associating the provided key.voidStore all key value pairs from provided map.Remove the value associated to the provided key.
-
Constructor Details
-
DefaultValueStore
public DefaultValueStore()
-
-
Method Details
-
get
Description copied from interface:ValueStoreGet the value associated to the key.- Specified by:
getin interfaceValueStore- Parameters:
key- key- Returns:
- value; can be
null
-
get
Description copied from interface:ValueStoreGet the value associated to the key and cast to the type.- Specified by:
getin interfaceValueStore- Type Parameters:
T- value type- Parameters:
key- keytype- value type to cast- Returns:
- value; can be
null
-
getOrDefault
Description copied from interface:ValueStoreGet the value associated to the key; otherwise returns specified value.- Specified by:
getOrDefaultin interfaceValueStore- Type Parameters:
T- value type- Parameters:
key- keydefaultValue- default value- Returns:
- value
-
put
Description copied from interface:ValueStoreStore a value associating the provided key.- Specified by:
putin interfaceValueStore- Parameters:
key- keyvalue- value
-
putAll
Description copied from interface:ValueStoreStore all key value pairs from provided map.- Specified by:
putAllin interfaceValueStore- Parameters:
map- map
-
remove
Description copied from interface:ValueStoreRemove the value associated to the provided key.- Specified by:
removein interfaceValueStore- Parameters:
key- key- Returns:
- previously associated value or
nullif key did not exist
-