Package discord4j.store.api.noop
Class NoOpStore<K extends Comparable<K>,V>
- java.lang.Object
-
- discord4j.store.api.noop.NoOpStore<K,V>
-
- All Implemented Interfaces:
ReadOnlyStore<K,V>,Store<K,V>
public class NoOpStore<K extends Comparable<K>,V> extends Object implements Store<K,V>
Data connection implementation which does nothing.- See Also:
NoOpStore,NoOpLongObjStore
-
-
Constructor Summary
Constructors Constructor Description NoOpStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Long>count()Retrieves the amount of stored values in the data source currently.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<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.Mono<Void>invalidate()Invalidates the contents of the store.Flux<K>keys()Gets a stream of all keys in the data source.Mono<Void>save(K key, V value)Stores a key value pair.Mono<Void>save(Publisher<Tuple2<K,V>> entryStream)Stores key value pairs.Flux<V>values()Gets a stream of all values in the data source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface discord4j.store.api.ReadOnlyStore
entries
-
-
-
-
Method Detail
-
save
public Mono<Void> save(K key, V value)
Description copied from interface:StoreStores a key value pair.
-
save
public Mono<Void> save(Publisher<Tuple2<K,V>> entryStream)
Description copied from interface:StoreStores key value pairs.
-
find
public Mono<V> find(K id)
Description copied from interface:ReadOnlyStoreAttempts to find the value associated with the provided id.- Specified by:
findin interfaceReadOnlyStore<K extends Comparable<K>,V>- Parameters:
id- The id to search with.- Returns:
- A mono, which may or may not contain an associated object.
-
findInRange
public Flux<V> findInRange(K start, K end)
Description copied from interface:ReadOnlyStoreRetrieves all stored values with ids within a provided range.- Specified by:
findInRangein interfaceReadOnlyStore<K extends Comparable<K>,V>- Parameters:
start- The starting key (inclusive).end- The ending key (exclusive).- Returns:
- The stream of values with ids within the provided range.
-
count
public Mono<Long> count()
Description copied from interface:ReadOnlyStoreRetrieves the amount of stored values in the data source currently.- Specified by:
countin interfaceReadOnlyStore<K extends Comparable<K>,V>- Returns:
- A mono which provides the amount of stored values.
-
delete
public Mono<Void> delete(K id)
Description copied from interface:StoreDeletes a value associated with the provided id.
-
delete
public Mono<Void> delete(Publisher<K> ids)
Description copied from interface:StoreDeletes the values associated with the provided ids.
-
deleteInRange
public Mono<Void> deleteInRange(K start, K end)
Description copied from interface:StoreDeletes values within a range of ids.- Specified by:
deleteInRangein interfaceStore<K extends Comparable<K>,V>- Parameters:
start- The starting key (inclusive).end- The ending key (exclusive).- Returns:
- A mono which signals the completion of the deletion of values.
-
deleteAll
public Mono<Void> deleteAll()
Description copied from interface:StoreDeletes all entries in the data source.
-
keys
public Flux<K> keys()
Description copied from interface:ReadOnlyStoreGets a stream of all keys in the data source.- Specified by:
keysin interfaceReadOnlyStore<K extends Comparable<K>,V>- Returns:
- The stream of keys stored.
-
values
public Flux<V> values()
Description copied from interface:ReadOnlyStoreGets a stream of all values in the data source.- Specified by:
valuesin interfaceReadOnlyStore<K extends Comparable<K>,V>- Returns:
- The stream of values stored.
-
invalidate
public Mono<Void> invalidate()
Description copied from interface:StoreInvalidates the contents of the store. Once this is invoked, there is no longer a guarantee that the data in the store is reliable.- Specified by:
invalidatein interfaceStore<K extends Comparable<K>,V>- Returns:
- A mono which signals the completion of the invalidation of all values.
-
-