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 TypeMethodDescriptionReturns the value associated with the key.<T> TReturns the value associated with the key and casts it to the specified type.<T> TgetOrDefault(Object key, T defaultValue) Returns the value associated with the key, or the specified default value if none exists.voidStores the provided value under the provided key.voidStores all key/value pairs from the provided map.Removes the value associated with the provided key.
-
Constructor Details
-
DefaultValueStore
public DefaultValueStore()
-
-
Method Details
-
get
Description copied from interface:ValueStoreReturns the value associated with the key.- Specified by:
getin interfaceValueStore- Parameters:
key- key- Returns:
- value; can be
null
-
get
Description copied from interface:ValueStoreReturns the value associated with the key and casts it to the specified 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:ValueStoreReturns the value associated with the key, or the specified default value if none exists.- Specified by:
getOrDefaultin interfaceValueStore- Type Parameters:
T- value type- Parameters:
key- keydefaultValue- default value- Returns:
- value
-
put
Description copied from interface:ValueStoreStores the provided value under the provided key.- Specified by:
putin interfaceValueStore- Parameters:
key- keyvalue- value
-
putAll
Description copied from interface:ValueStoreStores all key/value pairs from the provided map.- Specified by:
putAllin interfaceValueStore- Parameters:
map- map
-
remove
Description copied from interface:ValueStoreRemoves the value associated with the provided key.- Specified by:
removein interfaceValueStore- Parameters:
key- key- Returns:
- previously associated value or
nullif key did not exist
-