Package org.togglz.redis
Class RedisLettuceStateRepository.Builder
- java.lang.Object
-
- org.togglz.redis.RedisLettuceStateRepository.Builder
-
- Enclosing class:
- RedisLettuceStateRepository
public static class RedisLettuceStateRepository.Builder extends Object
Builder for aRedisLettuceStateRepository.Can be used as follows:
StateRepository stateRepository = new RedisLettuceStateRepository.Builder(). lettucePool(ConnectionPoolSupport.createGenericObjectPool( () -> RedisClient.create(RedisURI.create("localhost", 6379)).connect(), new GenericObjectPoolConfig())) keyPrefix("toggles:"). build();
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RedisLettuceStateRepositorybuild()Creates a newRedisLettuceStateRepositoryusing the current settings.RedisLettuceStateRepository.BuilderkeyPrefix(String keyPrefix)Sets the Redis key prefix to be used when getting or setting the state of the features.RedisLettuceStateRepository.BuilderlettucePool(org.apache.commons.pool2.impl.GenericObjectPool<io.lettuce.core.api.StatefulConnection<String,String>> lettucePool)Sets the Lettuce Pool.
-
-
-
Method Detail
-
lettucePool
public RedisLettuceStateRepository.Builder lettucePool(org.apache.commons.pool2.impl.GenericObjectPool<io.lettuce.core.api.StatefulConnection<String,String>> lettucePool)
Sets the Lettuce Pool.- Parameters:
lettucePool- the Lettuce PoolGenericObjectPool
-
keyPrefix
public RedisLettuceStateRepository.Builder keyPrefix(String keyPrefix)
Sets the Redis key prefix to be used when getting or setting the state of the features.- Parameters:
keyPrefix- the key prefix to be used in Redis
-
build
public RedisLettuceStateRepository build()
Creates a newRedisLettuceStateRepositoryusing the current settings.
-
-