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> T
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
Store a value associating the provided key.void
Store 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:ValueStore
Get the value associated to the key.- Specified by:
get
in interfaceValueStore
- Parameters:
key
- key- Returns:
- value; can be
null
-
get
Description copied from interface:ValueStore
Get the value associated to the key and cast to the type.- Specified by:
get
in interfaceValueStore
- Type Parameters:
T
- value type- Parameters:
key
- keytype
- value type to cast- Returns:
- value; can be
null
-
getOrDefault
Description copied from interface:ValueStore
Get the value associated to the key; otherwise returns specified value.- Specified by:
getOrDefault
in interfaceValueStore
- Type Parameters:
T
- value type- Parameters:
key
- keydefaultValue
- default value- Returns:
- value
-
put
Description copied from interface:ValueStore
Store a value associating the provided key.- Specified by:
put
in interfaceValueStore
- Parameters:
key
- keyvalue
- value
-
putAll
Description copied from interface:ValueStore
Store all key value pairs from provided map.- Specified by:
putAll
in interfaceValueStore
- Parameters:
map
- map
-
remove
Description copied from interface:ValueStore
Remove the value associated to the provided key.- Specified by:
remove
in interfaceValueStore
- Parameters:
key
- key- Returns:
- previously associated value or
null
if key did not exist
-