Package discord4j.store.jdk
Class JdkCachingStore<K extends Comparable<K>,V>
- java.lang.Object
-
- discord4j.store.jdk.JdkCachingStore<K,V>
-
- Type Parameters:
K- the store keysV- the store values
- All Implemented Interfaces:
ReadOnlyStore<K,V>,Store<K,V>
public class JdkCachingStore<K extends Comparable<K>,V> extends Object implements Store<K,V>
AStorethat can delegate storage while keeping a cache above it, using a JDKConcurrentHashMap.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Long>count()Mono<Void>delete(K id)Mono<Void>delete(Publisher<K> ids)Mono<Void>deleteAll()Mono<Void>deleteInRange(K start, K end)Mono<V>find(K id)Flux<V>findInRange(K start, K end)Mono<Void>invalidate()Flux<K>keys()Mono<Void>save(K key, V value)Mono<Void>save(Publisher<Tuple2<K,V>> entryStream)Flux<V>values()-
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
-
find
public Mono<V> find(K id)
- Specified by:
findin interfaceReadOnlyStore<K extends Comparable<K>,V>
-
findInRange
public Flux<V> findInRange(K start, K end)
- Specified by:
findInRangein interfaceReadOnlyStore<K extends Comparable<K>,V>
-
count
public Mono<Long> count()
- Specified by:
countin interfaceReadOnlyStore<K extends Comparable<K>,V>
-
keys
public Flux<K> keys()
- Specified by:
keysin interfaceReadOnlyStore<K extends Comparable<K>,V>
-
values
public Flux<V> values()
- Specified by:
valuesin interfaceReadOnlyStore<K extends Comparable<K>,V>
-
deleteInRange
public Mono<Void> deleteInRange(K start, K end)
- Specified by:
deleteInRangein interfaceStore<K extends Comparable<K>,V>
-
invalidate
public Mono<Void> invalidate()
- Specified by:
invalidatein interfaceStore<K extends Comparable<K>,V>
-
-