Package discord4j.common.store.impl
Class StorageConfig.Builder
- java.lang.Object
-
- discord4j.common.store.impl.StorageConfig.Builder
-
- Enclosing class:
- StorageConfig
public static class StorageConfig.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageConfigbuild()Builds theStorageConfig.StorageConfig.BuildersetInvalidationFilter(EnumSet<InvalidationCause> invalidationFilter)Sets the filter represented as a subset ofInvalidationCauseto apply when a shard is invalidated.StorageConfig.BuildersetMessageBackend(StorageBackend messageBackend)Sets theStorageBackendto use for message caching.
-
-
-
Method Detail
-
setMessageBackend
public StorageConfig.Builder setMessageBackend(@Nullable StorageBackend messageBackend)
Sets theStorageBackendto use for message caching. By default it uses a backend based on Caffeine that keeps only the last 1000 messages.- Parameters:
messageBackend- theStorageBackend, or null to use default- Returns:
- this builder
-
setInvalidationFilter
public StorageConfig.Builder setInvalidationFilter(@Nullable EnumSet<InvalidationCause> invalidationFilter)
Sets the filter represented as a subset ofInvalidationCauseto apply when a shard is invalidated. Only the causes included in the set will trigger cleanup of data related to the shard that's being invalidated. By default no filter is applied and data will be cleared on shard invalidation regardless of the reason (EnumSet.allOf(InvalidationCause.class))- Parameters:
invalidationFilter- the filter as anEnumSet, or null to use default- Returns:
- this builder
-
build
public StorageConfig build()
Builds theStorageConfig.- Returns:
- a new
StorageConfig
-
-