-
public interface DataStoreHandlerInterface for the datastore.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDataStoreHandler.Companion
-
Method Summary
Modifier and Type Method Description abstract <T extends Any> UnitsetValue(String key, T data, Integer version, DataStoreWriteCallback callback, Serializer<T> serializer)Write data to the datastore. abstract <T extends Any> Unitvalue(String key, Integer version, DataStoreReadCallback<T> callback, Deserializer<String, T> deserializer)Read data from the datastore. abstract UnitremoveValue(String key, DataStoreWriteCallback callback)Remove an entry from the datastore. abstract UnitclearAllData()Removes all saved datastore entries. -
-
Method Detail
-
setValue
abstract <T extends Any> Unit setValue(String key, T data, Integer version, DataStoreWriteCallback callback, Serializer<T> serializer)
Write data to the datastore. This executes on a worker thread and not on the caller thread.
- Parameters:
key- name of the datastore entry.data- to write.version- optional version for the entry.callback- (optional) to indicate whether the operation succeeded or not.serializer- to use to serialize the data.
-
value
abstract <T extends Any> Unit value(String key, Integer version, DataStoreReadCallback<T> callback, Deserializer<String, T> deserializer)
Read data from the datastore. This executes on a worker thread and not on the caller thread.
- Parameters:
key- name of the datastore entry.version- optional version to use when reading from the datastore.callback- to return result asynchronously.deserializer- to use to deserialize the data.
-
removeValue
abstract Unit removeValue(String key, DataStoreWriteCallback callback)
Remove an entry from the datastore. This executes on a worker thread and not on the caller thread.
- Parameters:
key- name of the datastore entrycallback- (optional) to indicate whether the operation succeeded or not.
-
clearAllData
abstract Unit clearAllData()
Removes all saved datastore entries.
-
-
-
-