Package org.localify.common
Class KeyValueStore
java.lang.Object
org.localify.common.KeyValueStore
A simple key-value store backed by a database table.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetValueForKey(String key) Gets the value for a given key.voidupsertKeyValue(String key, String value) Inserts or updates a key-value pair.
-
Constructor Details
-
KeyValueStore
public KeyValueStore()
-
-
Method Details
-
getValueForKey
Gets the value for a given key.- Parameters:
key- The key.- Returns:
- The value, or null if the key is not found.
-
upsertKeyValue
Inserts or updates a key-value pair.- Parameters:
key- The key.value- The value.
-