Class RedisManager.Builder
java.lang.Object
net.blockhost.commons.database.redis.RedisManager.Builder
- Enclosing class:
RedisManager
Builder for creating RedisManager instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the RedisManager instance.config(RedisConfig config) Sets the Redis configuration.infoLogger(Consumer<String> infoLogger) Sets a custom info log consumer.Sets the logger for Redis messages.warningLogger(Consumer<String> warningLogger) Sets a custom warning log consumer.
-
Method Details
-
config
Sets the Redis configuration.- Parameters:
config- the Redis configuration- Returns:
- this builder
-
logger
Sets the logger for Redis messages.- Parameters:
logger- the logger to use- Returns:
- this builder
-
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
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
Builds the RedisManager instance.- Returns:
- a new RedisManager
- Throws:
NullPointerException- if config is not set
-