Package discord4j.store.api
Interface ReadOnlyStore<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 Known Subinterfaces:
LongObjStore<V>,Store<K,V>
- All Known Implementing Classes:
DelegatingLongObjStore,DelegatingStore,ForwardingStore,NoOpLongObjStore,NoOpStore,ReadOnlyLongObjStore,ReadOnlyStore
public interface ReadOnlyStore<K extends Comparable<K>,V>A store that only supports read operations.- See Also:
LongObjStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Mono<Long>count()Retrieves the amount of stored values in the data source currently.default Flux<Tuple2<K,V>>entries()Gets a stream of all entries in the data source.Mono<V>find(K id)Attempts to find the value associated with the provided id.Flux<V>findInRange(K start, K end)Retrieves all stored values with ids within a provided range.Flux<K>keys()Gets a stream of all keys in the data source.Flux<V>values()Gets a stream of all values in the data source.
-
-
-
Method Detail
-
find
Mono<V> find(K id)
Attempts to find the value associated with the provided id.- Parameters:
id- The id to search with.- Returns:
- A mono, which may or may not contain an associated object.
-
findInRange
Flux<V> findInRange(K start, K end)
Retrieves all stored values with ids within a provided range.- Parameters:
start- The starting key (inclusive).end- The ending key (exclusive).- Returns:
- The stream of values with ids within the provided range.
-
count
Mono<Long> count()
Retrieves the amount of stored values in the data source currently.- Returns:
- A mono which provides the amount of stored values.
-
keys
Flux<K> keys()
Gets a stream of all keys in the data source.- Returns:
- The stream of keys stored.
-
values
Flux<V> values()
Gets a stream of all values in the data source.- Returns:
- The stream of values stored.
-
-