Package discord4j.store.api
Interface Store<K extends Comparable<K>,V>
-
- Type Parameters:
K- The key type which provides a 1:1 mapping to the value type. This type is also expected to beComparablein order to allow for range operations.V- The value type, these follow JavaBean conventions.
- All Superinterfaces:
ReadOnlyStore<K,V>
- All Known Subinterfaces:
LongObjStore<V>
- All Known Implementing Classes:
DelegatingLongObjStore,DelegatingStore,ForwardingStore,NoOpLongObjStore,NoOpStore,ReadOnlyLongObjStore,ReadOnlyStore
public interface Store<K extends Comparable<K>,V> extends ReadOnlyStore<K,V>
This provides an active data connection to a store's data source, supporting read and write operations.- See Also:
LongObjStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Mono<Void>delete(K id)Deletes a value associated with the provided id.Mono<Void>delete(Publisher<K> ids)Deletes the values associated with the provided ids.Mono<Void>deleteAll()Deletes all entries in the data source.Mono<Void>deleteInRange(K start, K end)Deletes values within a range of ids.Mono<Void>invalidate()Invalidates the contents of the store.Mono<Void>save(K key, V value)Stores a key value pair.Mono<Void>save(Publisher<Tuple2<K,V>> entryStream)Stores key value pairs.-
Methods inherited from interface discord4j.store.api.ReadOnlyStore
count, entries, find, findInRange, keys, values
-
-
-
-
Method Detail
-
save
Mono<Void> save(K key, V value)
Stores a key value pair.- Parameters:
key- The key representing the value.value- The value.- Returns:
- A mono which signals the completion of the storage of the pair.
-
save
Mono<Void> save(Publisher<Tuple2<K,V>> entryStream)
Stores key value pairs.- Parameters:
entryStream- A flux providing the key value pairs.- Returns:
- A mono which signals the completion of the storage of the pairs.
-
delete
Mono<Void> delete(K id)
Deletes a value associated with the provided id.- Parameters:
id- The id of the value to delete.- Returns:
- A mono which signals the completion of the deletion of the value.
-
delete
Mono<Void> delete(Publisher<K> ids)
Deletes the values associated with the provided ids.- Parameters:
ids- A stream of ids to delete values for.- Returns:
- A mono which signals the completion of the deletion of the values.
-
deleteInRange
Mono<Void> deleteInRange(K start, K end)
Deletes values within a range of ids.- Parameters:
start- The starting key (inclusive).end- The ending key (exclusive).- Returns:
- A mono which signals the completion of the deletion of values.
-
deleteAll
Mono<Void> deleteAll()
Deletes all entries in the data source.- Returns:
- A mono which signals the completion of the deletion of all values.
-
-