Interface ServerConfigStorageProvider
- All Superinterfaces:
Provider
- All Known Implementing Classes:
JpaServerConfigStorageProvider
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value to which the specifiedkey.default StringloadOrCreate(String key, String value) Same asloadOrCreate(key, () -> value).loadOrCreate(String key, Supplier<String> valueGenerator) Returns the value to which the specifiedkeyor, if not found, stores the value returned by thevalueGenerator.voidRemoves thevaluespecified by thekey.default booleanSame asreplace(key, Objects.requireNonNull(expected)::equals, () -> Objects.requireNonNull(newValue)).booleanvoidStores the specifiedvaluewith the specifiedkey.
-
Method Details
-
find
Returns the value to which the specifiedkey.- Parameters:
key- Thekeywhose associated value is to be returned.- Returns:
- The value from the specified
key. - Throws:
NullPointerException- if the specifiedkeyisnull.
-
store
Stores the specifiedvaluewith the specifiedkey.If the
keyexists, its value is updated.- Parameters:
key- Thekeywith which the specifiedvalueis to be stored.value- Thevalueto be associated with the specifiedkey.- Throws:
NullPointerException- if the specifiedkeyorvalueisnull.
-
remove
Removes thevaluespecified by thekey.- Parameters:
key- Thekeywhose value is to be removed.- Throws:
NullPointerException- if the specifiedkeyisnull.
-
loadOrCreate
Returns the value to which the specifiedkeyor, if not found, stores the value returned by thevalueGenerator.- Parameters:
key- Thekeywhose associated value is to be returned or stored.valueGenerator- TheSupplierto 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,valueGeneratororSupplierreturn value isnull.
-
loadOrCreate
Same asloadOrCreate(key, () -> value).- See Also:
-
replace
Same asreplace(key, Objects.requireNonNull(expected)::equals, () -> Objects.requireNonNull(newValue)).- See Also:
-
replace
-