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 StorageBackendcaffeine(UnaryOperator<com.github.benmanes.caffeine.cache.Caffeine<Object, Object>> caffeineBuilder) Represents aCaffeinebackend with the given configuration.static StorageBackendRepresents aConcurrentHashMapbackend.default <K,V> ConcurrentMap<K, V> newMap()<K,V> ConcurrentMap<K, V> newMap(com.github.benmanes.caffeine.cache.RemovalListener<K, V> removalListener) static StorageBackendnoOp()Represents a backend that doesn't store anything.
-
Method Details
-
noOp
Represents a backend that doesn't store anything.- Returns:
- a
StorageBackend
-
concurrentHashMap
Represents aConcurrentHashMapbackend.- Returns:
- a
StorageBackend
-
caffeine
static StorageBackend caffeine(UnaryOperator<com.github.benmanes.caffeine.cache.Caffeine<Object, Object>> caffeineBuilder) Represents aCaffeinebackend with the given configuration.- Parameters:
caffeineBuilder- a transformer for aCaffeinebuilder- Returns:
- a
StorageBackend
-
newMap
-
newMap
<K,V> ConcurrentMap<K,V> newMap(@Nullable com.github.benmanes.caffeine.cache.RemovalListener<K, V> removalListener)
-