Class StorageConfig.Builder

java.lang.Object
discord4j.common.store.impl.StorageConfig.Builder
Enclosing class:
StorageConfig

public static class StorageConfig.Builder extends Object
  • Method Details

    • setMessageBackend

      public StorageConfig.Builder setMessageBackend(@Nullable StorageBackend messageBackend)
      Sets the StorageBackend to use for message caching. By default it uses a backend based on Caffeine that keeps only the last 1000 messages.
      Parameters:
      messageBackend - the StorageBackend, or null to use default
      Returns:
      this builder
    • setInvalidationFilter

      public StorageConfig.Builder setInvalidationFilter(@Nullable EnumSet<InvalidationCause> invalidationFilter)
      Sets the filter represented as a subset of InvalidationCause to 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 an EnumSet, or null to use default
      Returns:
      this builder
    • build

      public StorageConfig build()
      Builds the StorageConfig.
      Returns:
      a new StorageConfig