Package discord4j.common.store.impl
Interface StorageBackend
-
public interface StorageBackendFactory for a ConcurrentMap backing the different storages. You may use one of the static methods of this interface to get instances.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static StorageBackendcaffeine(UnaryOperator<com.github.benmanes.caffeine.cache.Caffeine<Object,Object>> caffeineBuilder)Represents aCaffeinebackend with the given configuration.static StorageBackendconcurrentHashMap()Represents 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 Detail
-
noOp
static StorageBackend noOp()
Represents a backend that doesn't store anything.- Returns:
- a
StorageBackend
-
concurrentHashMap
static 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
default <K,V> ConcurrentMap<K,V> newMap()
-
newMap
<K,V> ConcurrentMap<K,V> newMap(@Nullable com.github.benmanes.caffeine.cache.RemovalListener<K,V> removalListener)
-
-