DATAREDIS-930 - Polishing.
Add since tags. Simplify test using Lombok annotations. Reformat code. Original pull request: #385.
This commit is contained in:
@@ -90,6 +90,7 @@ public interface RedisConfiguration {
|
||||
/**
|
||||
* @param configuration can be {@literal null}.
|
||||
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link WithHostAndPort}.
|
||||
* @since 2.1.6
|
||||
*/
|
||||
static boolean isHostAndPortAware(@Nullable RedisConfiguration configuration) {
|
||||
return configuration instanceof WithHostAndPort;
|
||||
@@ -151,6 +152,7 @@ public interface RedisConfiguration {
|
||||
* {@link #isHostAndPortAware(RedisConfiguration) port aware}.
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException if {@code other} is {@literal null}.
|
||||
* @since 2.1.6
|
||||
*/
|
||||
static int getPortOrElse(@Nullable RedisConfiguration configuration, IntSupplier other) {
|
||||
|
||||
@@ -164,6 +166,7 @@ public interface RedisConfiguration {
|
||||
* {@link #isHostAndPortAware(RedisConfiguration) host aware}.
|
||||
* @return never {@literal null}.
|
||||
* @throws IllegalArgumentException if {@code other} is {@literal null}.
|
||||
* @since 2.1.6
|
||||
*/
|
||||
static String getHostOrElse(@Nullable RedisConfiguration configuration, Supplier<String> other) {
|
||||
|
||||
|
||||
@@ -1008,8 +1008,8 @@ public class LettuceConnectionFactory
|
||||
|
||||
private RedisURI getSentinelRedisURI() {
|
||||
|
||||
RedisURI redisUri = LettuceConverters
|
||||
.sentinelConfigurationToRedisURI((org.springframework.data.redis.connection.RedisSentinelConfiguration) configuration);
|
||||
RedisURI redisUri = LettuceConverters.sentinelConfigurationToRedisURI(
|
||||
(org.springframework.data.redis.connection.RedisSentinelConfiguration) configuration);
|
||||
|
||||
getRedisPassword().toOptional().ifPresent(redisUri::setPassword);
|
||||
clientConfiguration.getClientName().ifPresent(redisUri::setClientName);
|
||||
|
||||
Reference in New Issue
Block a user