Package discord4j.store.jdk
Class JdkStore<K extends Comparable<K>,V>
- java.lang.Object
-
- discord4j.store.jdk.JdkStore<K,V>
-
- Type Parameters:
K- the store keysV- the store values
- All Implemented Interfaces:
ReadOnlyStore<K,V>,Store<K,V>
public class JdkStore<K extends Comparable<K>,V> extends Object implements Store<K,V>
-
-
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)Flux<Tuple2<K,V>>entries()Mono<V>find(K id)Flux<V>findInRange(K start, K end)protected Map<K,V>getMap()Mono<Void>invalidate()Flux<K>keys()Mono<Void>save(K key, V value)Mono<Void>save(Publisher<Tuple2<K,V>> entryStream)StringtoString()Flux<V>values()
-
-
-
Constructor Detail
-
JdkStore
public JdkStore(boolean persist)
- Parameters:
persist- whether this store is expected to hold onto the stored values indefinitely. Will use aConcurrentHashMapas backing iftrue, and a thread-safeWeakHashMapotherwise.
-
-
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>
-
deleteInRange
public Mono<Void> deleteInRange(K start, K end)
- Specified by:
deleteInRangein interfaceStore<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>
-
entries
public Flux<Tuple2<K,V>> entries()
- Specified by:
entriesin interfaceReadOnlyStore<K extends Comparable<K>,V>
-
invalidate
public Mono<Void> invalidate()
- Specified by:
invalidatein interfaceStore<K extends Comparable<K>,V>
-
-