Class RedisManager.Builder

java.lang.Object
net.blockhost.commons.database.redis.RedisManager.Builder
Enclosing class:
RedisManager

public static final class RedisManager.Builder extends Object
Builder for creating RedisManager instances.
  • Method Details

    • config

      public RedisManager.Builder config(RedisConfig config)
      Sets the Redis configuration.
      Parameters:
      config - the Redis configuration
      Returns:
      this builder
    • logger

      public RedisManager.Builder logger(@Nullable Logger logger)
      Sets the logger for Redis messages.
      Parameters:
      logger - the logger to use
      Returns:
      this builder
    • infoLogger

      public RedisManager.Builder infoLogger(Consumer<String> infoLogger)

      Sets a custom info log consumer.

      If set, this will be used instead of the logger for info messages.

      Parameters:
      infoLogger - the info log consumer
      Returns:
      this builder
    • warningLogger

      public RedisManager.Builder warningLogger(Consumer<String> warningLogger)

      Sets a custom warning log consumer.

      If set, this will be used instead of the logger for warning messages.

      Parameters:
      warningLogger - the warning log consumer
      Returns:
      this builder
    • build

      public RedisManager build()
      Builds the RedisManager instance.
      Returns:
      a new RedisManager
      Throws:
      NullPointerException - if config is not set