Interface ServerConfigStorageProvider
- All Superinterfaces:
Provider
- All Known Implementing Classes:
JpaServerConfigStorageProvider
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value to which the specifiedkey
.loadOrCreate
(String key, Supplier<String> valueGenerator) Returns the value to which the specifiedkey
or, if not found, stores the value returned by thevalueGenerator
.void
Removes thevalue
specified by thekey
.void
Stores the specifiedvalue
with the specifiedkey
.
-
Method Details
-
find
Returns the value to which the specifiedkey
.- Parameters:
key
- Thekey
whose associated value is to be returned.- Returns:
- The value from the specified
key
. - Throws:
NullPointerException
- if the specifiedkey
isnull
.
-
store
Stores the specifiedvalue
with the specifiedkey
.If the
key
exists, its value is updated.- Parameters:
key
- Thekey
with which the specifiedvalue
is to be stored.value
- Thevalue
to be associated with the specifiedkey
.- Throws:
NullPointerException
- if the specifiedkey
orvalue
isnull
.
-
remove
Removes thevalue
specified by thekey
.- Parameters:
key
- Thekey
whose value is to be removed.- Throws:
NullPointerException
- if the specifiedkey
isnull
.
-
loadOrCreate
Returns the value to which the specifiedkey
or, if not found, stores the value returned by thevalueGenerator
.- Parameters:
key
- Thekey
whose associated value is to be returned or stored.valueGenerator
- TheSupplier
to generate the value if it is not found.- Returns:
- The {value stored by the
key
, or the value generated by theSupplier
. - Throws:
NullPointerException
- if the specifiedkey
,valueGenerator
orSupplier
return value isnull
.
-