Package discord4j.common.store.impl
Class StorageConfig.Builder
java.lang.Object
discord4j.common.store.impl.StorageConfig.Builder
- Enclosing class:
- StorageConfig
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theStorageConfig.setInvalidationFilter(EnumSet<InvalidationCause> invalidationFilter) Sets the filter represented as a subset ofInvalidationCauseto apply when a shard is invalidated.setMessageBackend(StorageBackend messageBackend) Sets theStorageBackendto use for message caching.
-
Method Details
-
setMessageBackend
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
Builds theStorageConfig.- Returns:
- a new
StorageConfig
-