Package discord4j.common.store.impl
Interface StorageBackend
public interface StorageBackend
Factory for a ConcurrentMap backing the different storages. You may use one of the static methods of this
interface to get instances.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StorageBackend
caffeine
(UnaryOperator<com.github.benmanes.caffeine.cache.Caffeine<Object, Object>> caffeineBuilder) Represents aCaffeine
backend with the given configuration.static StorageBackend
Represents aConcurrentHashMap
backend.default <K,
V> ConcurrentMap<K, V> newMap()
<K,
V> ConcurrentMap<K, V> newMap
(com.github.benmanes.caffeine.cache.RemovalListener<K, V> removalListener) static StorageBackend
noOp()
Represents a backend that doesn't store anything.
-
Method Details
-
noOp
Represents a backend that doesn't store anything.- Returns:
- a
StorageBackend
-
concurrentHashMap
Represents aConcurrentHashMap
backend.- Returns:
- a
StorageBackend
-
caffeine
static StorageBackend caffeine(UnaryOperator<com.github.benmanes.caffeine.cache.Caffeine<Object, Object>> caffeineBuilder) Represents aCaffeine
backend with the given configuration.- Parameters:
caffeineBuilder
- a transformer for aCaffeine
builder- Returns:
- a
StorageBackend
-
newMap
-
newMap
<K,V> ConcurrentMap<K,V> newMap(@Nullable com.github.benmanes.caffeine.cache.RemovalListener<K, V> removalListener)
-