diff --git a/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java b/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java index ca5884437..025da64ee 100644 --- a/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java +++ b/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java @@ -63,7 +63,7 @@ public abstract class BatchStrategies { */ public static BatchStrategy scan(int batchSize) { - Assert.isTrue(batchSize > 0, "Batch size must be greater than zero!"); + Assert.isTrue(batchSize > 0, "Batch size must be greater than zero"); return new Scan(batchSize); } diff --git a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java index b203992d4..e7eab7b6b 100644 --- a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java +++ b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java @@ -64,7 +64,7 @@ public interface CacheKeyPrefix { */ static CacheKeyPrefix prefixed(String prefix) { - Assert.notNull(prefix, "Prefix must not be null!"); + Assert.notNull(prefix, "Prefix must not be null"); return name -> prefix + name + SEPARATOR; } } diff --git a/src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java b/src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java index 1252305a6..97ab8c36a 100644 --- a/src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java +++ b/src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java @@ -81,10 +81,10 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { DefaultRedisCacheWriter(RedisConnectionFactory connectionFactory, Duration sleepTime, CacheStatisticsCollector cacheStatisticsCollector, BatchStrategy batchStrategy) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); - Assert.notNull(sleepTime, "SleepTime must not be null!"); - Assert.notNull(cacheStatisticsCollector, "CacheStatisticsCollector must not be null!"); - Assert.notNull(batchStrategy, "BatchStrategy must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(sleepTime, "SleepTime must not be null"); + Assert.notNull(cacheStatisticsCollector, "CacheStatisticsCollector must not be null"); + Assert.notNull(batchStrategy, "BatchStrategy must not be null"); this.connectionFactory = connectionFactory; this.sleepTime = sleepTime; @@ -95,9 +95,9 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { @Override public void put(String name, byte[] key, byte[] value, @Nullable Duration ttl) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); execute(name, connection -> { @@ -116,8 +116,8 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { @Override public byte[] get(String name, byte[] key) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(key, "Key must not be null"); byte[] result = execute(name, connection -> connection.get(key)); @@ -135,9 +135,9 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { @Override public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Duration ttl) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return execute(name, connection -> { @@ -173,8 +173,8 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { @Override public void remove(String name, byte[] key) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(key, "Key must not be null"); execute(name, connection -> connection.del(key)); statistics.incDeletes(name); @@ -183,8 +183,8 @@ class DefaultRedisCacheWriter implements RedisCacheWriter { @Override public void clean(String name, byte[] pattern) { - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(pattern, "Pattern must not be null"); execute(name, connection -> { diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCache.java b/src/main/java/org/springframework/data/redis/cache/RedisCache.java index 17cb9d2f1..59dfb833d 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCache.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCache.java @@ -69,9 +69,9 @@ public class RedisCache extends AbstractValueAdaptingCache { super(cacheConfig.getAllowCacheNullValues()); - Assert.notNull(name, "Name must not be null!"); - Assert.notNull(cacheWriter, "CacheWriter must not be null!"); - Assert.notNull(cacheConfig, "CacheConfig must not be null!"); + Assert.notNull(name, "Name must not be null"); + Assert.notNull(cacheWriter, "CacheWriter must not be null"); + Assert.notNull(cacheConfig, "CacheConfig must not be null"); this.name = name; this.cacheWriter = cacheWriter; @@ -141,7 +141,7 @@ public class RedisCache extends AbstractValueAdaptingCache { if (!isAllowNullValues() && cacheValue == null) { throw new IllegalArgumentException(String.format( - "Cache '%s' does not allow 'null' values. Avoid storing null via '@Cacheable(unless=\"#result == null\")' or configure RedisCache to allow 'null' via RedisCacheConfiguration.", + "Cache '%s' does not allow 'null' values; Avoid storing null via '@Cacheable(unless=\"#result == null\")' or configure RedisCache to allow 'null' via RedisCacheConfiguration", name)); } @@ -319,7 +319,7 @@ public class RedisCache extends AbstractValueAdaptingCache { } throw new IllegalStateException(String.format( - "Cannot convert cache key %s to String. Please register a suitable Converter via 'RedisCacheConfiguration.configureKeyConverters(...)' or override '%s.toString()'.", + "Cannot convert cache key %s to String; Please register a suitable Converter via 'RedisCacheConfiguration.configureKeyConverters(...)' or override '%s.toString()'", source, key.getClass().getSimpleName())); } @@ -348,7 +348,7 @@ public class RedisCache extends AbstractValueAdaptingCache { return "[" + sj.toString() + "]"; } - throw new IllegalArgumentException(String.format("Cannot convert cache key %s to String.", key)); + throw new IllegalArgumentException(String.format("Cannot convert cache key %s to String", key)); } private boolean isCollectionLikeOrMap(TypeDescriptor source) { diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java index 07bc8190d..8aa667cfd 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java @@ -136,7 +136,7 @@ public class RedisCacheConfiguration { */ public RedisCacheConfiguration entryTtl(Duration ttl) { - Assert.notNull(ttl, "TTL duration must not be null!"); + Assert.notNull(ttl, "TTL duration must not be null"); return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair, valueSerializationPair, conversionService); @@ -167,7 +167,7 @@ public class RedisCacheConfiguration { */ public RedisCacheConfiguration computePrefixWith(CacheKeyPrefix cacheKeyPrefix) { - Assert.notNull(cacheKeyPrefix, "Function for computing prefix must not be null!"); + Assert.notNull(cacheKeyPrefix, "Function for computing prefix must not be null"); return new RedisCacheConfiguration(ttl, cacheNullValues, true, cacheKeyPrefix, keySerializationPair, valueSerializationPair, conversionService); @@ -207,7 +207,7 @@ public class RedisCacheConfiguration { */ public RedisCacheConfiguration withConversionService(ConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null!"); + Assert.notNull(conversionService, "ConversionService must not be null"); return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair, valueSerializationPair, conversionService); @@ -221,7 +221,7 @@ public class RedisCacheConfiguration { */ public RedisCacheConfiguration serializeKeysWith(SerializationPair keySerializationPair) { - Assert.notNull(keySerializationPair, "KeySerializationPair must not be null!"); + Assert.notNull(keySerializationPair, "KeySerializationPair must not be null"); return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair, valueSerializationPair, conversionService); @@ -235,7 +235,7 @@ public class RedisCacheConfiguration { */ public RedisCacheConfiguration serializeValuesWith(SerializationPair valueSerializationPair) { - Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null!"); + Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null"); return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair, valueSerializationPair, conversionService); @@ -249,7 +249,7 @@ public class RedisCacheConfiguration { */ public String getKeyPrefixFor(String cacheName) { - Assert.notNull(cacheName, "Cache name must not be null!"); + Assert.notNull(cacheName, "Cache name must not be null"); return keyPrefix.compute(cacheName); } @@ -320,8 +320,8 @@ public class RedisCacheConfiguration { if (!(getConversionService() instanceof ConverterRegistry)) { throw new IllegalStateException(String.format( - "'%s' returned by getConversionService() does not allow converter registration." // - + " Please make sure to provide a ConversionService that implements ConverterRegistry.", + "'%s' returned by getConversionService() does not allow converter registration;" // + + " Please make sure to provide a ConversionService that implements ConverterRegistry", getConversionService().getClass().getSimpleName())); } @@ -339,7 +339,7 @@ public class RedisCacheConfiguration { */ public static void registerDefaultConverters(ConverterRegistry registry) { - Assert.notNull(registry, "ConverterRegistry must not be null!"); + Assert.notNull(registry, "ConverterRegistry must not be null"); registry.addConverter(String.class, byte[].class, source -> source.getBytes(StandardCharsets.UTF_8)); registry.addConverter(SimpleKey.class, String.class, SimpleKey::toString); diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java index 4fb333157..adc1c3bc9 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java @@ -65,8 +65,8 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager private RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration, boolean allowInFlightCacheCreation) { - Assert.notNull(cacheWriter, "CacheWriter must not be null!"); - Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null!"); + Assert.notNull(cacheWriter, "CacheWriter must not be null"); + Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null"); this.cacheWriter = cacheWriter; this.defaultCacheConfig = defaultCacheConfiguration; @@ -159,7 +159,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager this(cacheWriter, defaultCacheConfiguration, allowInFlightCacheCreation); - Assert.notNull(initialCacheConfigurations, "InitialCacheConfigurations must not be null!"); + Assert.notNull(initialCacheConfigurations, "InitialCacheConfigurations must not be null"); this.initialCacheConfiguration.putAll(initialCacheConfigurations); } @@ -186,7 +186,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public static RedisCacheManager create(RedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); return new RedisCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory), RedisCacheConfiguration.defaultCacheConfig()); @@ -210,7 +210,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public static RedisCacheManagerBuilder builder(RedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); return RedisCacheManagerBuilder.fromConnectionFactory(connectionFactory); } @@ -223,7 +223,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public static RedisCacheManagerBuilder builder(RedisCacheWriter cacheWriter) { - Assert.notNull(cacheWriter, "CacheWriter must not be null!"); + Assert.notNull(cacheWriter, "CacheWriter must not be null"); return RedisCacheManagerBuilder.fromCacheWriter(cacheWriter); } @@ -303,7 +303,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public static RedisCacheManagerBuilder fromConnectionFactory(RedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); return new RedisCacheManagerBuilder(RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory)); } @@ -316,7 +316,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public static RedisCacheManagerBuilder fromCacheWriter(RedisCacheWriter cacheWriter) { - Assert.notNull(cacheWriter, "CacheWriter must not be null!"); + Assert.notNull(cacheWriter, "CacheWriter must not be null"); return new RedisCacheManagerBuilder(cacheWriter); } @@ -329,7 +329,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public RedisCacheManagerBuilder cacheDefaults(RedisCacheConfiguration defaultCacheConfiguration) { - Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null!"); + Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null"); this.defaultCacheConfiguration = defaultCacheConfiguration; @@ -345,7 +345,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public RedisCacheManagerBuilder cacheWriter(RedisCacheWriter cacheWriter) { - Assert.notNull(cacheWriter, "CacheWriter must not be null!"); + Assert.notNull(cacheWriter, "CacheWriter must not be null"); this.cacheWriter = cacheWriter; @@ -374,7 +374,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager */ public RedisCacheManagerBuilder initialCacheNames(Set cacheNames) { - Assert.notNull(cacheNames, "CacheNames must not be null!"); + Assert.notNull(cacheNames, "CacheNames must not be null"); cacheNames.forEach(it -> withCacheConfiguration(it, defaultCacheConfiguration)); return this; @@ -389,9 +389,9 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager public RedisCacheManagerBuilder withInitialCacheConfigurations( Map cacheConfigurations) { - Assert.notNull(cacheConfigurations, "CacheConfigurations must not be null!"); + Assert.notNull(cacheConfigurations, "CacheConfigurations must not be null"); cacheConfigurations.forEach((cacheName, configuration) -> Assert.notNull(configuration, - String.format("RedisCacheConfiguration for cache %s must not be null!", cacheName))); + String.format("RedisCacheConfiguration for cache %s must not be null", cacheName))); this.initialCaches.putAll(cacheConfigurations); return this; @@ -406,8 +406,8 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager public RedisCacheManagerBuilder withCacheConfiguration(String cacheName, RedisCacheConfiguration cacheConfiguration) { - Assert.notNull(cacheName, "CacheName must not be null!"); - Assert.notNull(cacheConfiguration, "CacheConfiguration must not be null!"); + Assert.notNull(cacheName, "CacheName must not be null"); + Assert.notNull(cacheConfiguration, "CacheConfiguration must not be null"); this.initialCaches.put(cacheName, cacheConfiguration); return this; @@ -469,7 +469,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager public RedisCacheManager build() { Assert.state(cacheWriter != null, - "CacheWriter must not be null! You can provide one via 'RedisCacheManagerBuilder#cacheWriter(RedisCacheWriter)'."); + "CacheWriter must not be null You can provide one via 'RedisCacheManagerBuilder#cacheWriter(RedisCacheWriter)'"); RedisCacheWriter theCacheWriter = cacheWriter; diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java index 19e62f8bd..3fbd79010 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java @@ -57,8 +57,8 @@ public interface RedisCacheWriter extends CacheStatisticsProvider { static RedisCacheWriter nonLockingRedisCacheWriter(RedisConnectionFactory connectionFactory, BatchStrategy batchStrategy) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); - Assert.notNull(batchStrategy, "BatchStrategy must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(batchStrategy, "BatchStrategy must not be null"); return new DefaultRedisCacheWriter(connectionFactory, batchStrategy); } @@ -84,7 +84,7 @@ public interface RedisCacheWriter extends CacheStatisticsProvider { static RedisCacheWriter lockingRedisCacheWriter(RedisConnectionFactory connectionFactory, BatchStrategy batchStrategy) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); return new DefaultRedisCacheWriter(connectionFactory, Duration.ofMillis(50), batchStrategy); } diff --git a/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java b/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java index 4b414193f..597c6613b 100644 --- a/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java +++ b/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java @@ -58,7 +58,7 @@ class RedisListenerContainerParser extends AbstractSimpleBeanDefinitionParser { if (isEligibleAttribute(attribute, parserContext)) { String propertyName = extractPropertyName(attribute.getLocalName()); Assert.state(StringUtils.hasText(propertyName), - "Illegal property name returned from 'extractPropertyName(String)': cannot be null or empty."); + "Illegal property name returned from 'extractPropertyName(String)': cannot be null or empty"); builder.addPropertyReference(propertyName, attribute.getValue()); } } diff --git a/src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java index 5c9a07a56..82fef3865 100644 --- a/src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java @@ -62,7 +62,7 @@ public abstract class AbstractRedisConnection implements RedisConnection { private RedisNode selectActiveSentinel() { - Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing!"); + Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing"); for (RedisNode node : this.sentinelConfiguration.getSentinels()) { if (isActive(node)) { diff --git a/src/main/java/org/springframework/data/redis/connection/BitFieldSubCommands.java b/src/main/java/org/springframework/data/redis/connection/BitFieldSubCommands.java index 814b0849d..c0dbc032f 100644 --- a/src/main/java/org/springframework/data/redis/connection/BitFieldSubCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/BitFieldSubCommands.java @@ -46,7 +46,7 @@ public class BitFieldSubCommands implements Iterable { this(subCommands); - Assert.notNull(subCommand, "SubCommand must not be null!"); + Assert.notNull(subCommand, "SubCommand must not be null"); this.subCommands.add(subCommand); } @@ -208,7 +208,7 @@ public class BitFieldSubCommands implements Iterable { */ public BitFieldSetBuilder valueAt(Offset offset) { - Assert.notNull(offset, "Offset must not be null!"); + Assert.notNull(offset, "Offset must not be null"); this.set.offset = offset; return this; @@ -263,7 +263,7 @@ public class BitFieldSubCommands implements Iterable { */ public BitFieldSubCommands valueAt(Offset offset) { - Assert.notNull(offset, "Offset must not be null!"); + Assert.notNull(offset, "Offset must not be null"); this.get.offset = offset; return ref.get(this.get); @@ -306,7 +306,7 @@ public class BitFieldSubCommands implements Iterable { */ public BitFieldIncrByBuilder valueAt(Offset offset) { - Assert.notNull(offset, "Offset must not be null!"); + Assert.notNull(offset, "Offset must not be null"); this.incrBy.offset = offset; return this; } diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java b/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java index b1fe48520..94e562b52 100644 --- a/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java +++ b/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java @@ -63,9 +63,9 @@ public class ClusterCommandExecutor implements DisposableBean { public ClusterCommandExecutor(ClusterTopologyProvider topologyProvider, ClusterNodeResourceProvider resourceProvider, ExceptionTranslationStrategy exceptionTranslation) { - Assert.notNull(topologyProvider, "ClusterTopologyProvider must not be null!"); - Assert.notNull(resourceProvider, "ClusterNodeResourceProvider must not be null!"); - Assert.notNull(exceptionTranslation, "ExceptionTranslationStrategy must not be null!"); + Assert.notNull(topologyProvider, "ClusterTopologyProvider must not be null"); + Assert.notNull(resourceProvider, "ClusterNodeResourceProvider must not be null"); + Assert.notNull(exceptionTranslation, "ExceptionTranslationStrategy must not be null"); this.topologyProvider = topologyProvider; this.resourceProvider = resourceProvider; @@ -101,7 +101,7 @@ public class ClusterCommandExecutor implements DisposableBean { */ public NodeResult executeCommandOnArbitraryNode(ClusterCommandCallback cmd) { - Assert.notNull(cmd, "ClusterCommandCallback must not be null!"); + Assert.notNull(cmd, "ClusterCommandCallback must not be null"); List nodes = new ArrayList<>(getClusterTopology().getActiveNodes()); return executeCommandOnSingleNode(cmd, nodes.get(new Random().nextInt(nodes.size()))); } @@ -121,19 +121,19 @@ public class ClusterCommandExecutor implements DisposableBean { private NodeResult executeCommandOnSingleNode(ClusterCommandCallback cmd, RedisClusterNode node, int redirectCount) { - Assert.notNull(cmd, "ClusterCommandCallback must not be null!"); - Assert.notNull(node, "RedisClusterNode must not be null!"); + Assert.notNull(cmd, "ClusterCommandCallback must not be null"); + Assert.notNull(node, "RedisClusterNode must not be null"); if (redirectCount > maxRedirects) { throw new TooManyClusterRedirectionsException(String.format( - "Cannot follow Cluster Redirects over more than %s legs. Please consider increasing the number of redirects to follow. Current value is: %s.", + "Cannot follow Cluster Redirects over more than %s legs; Please consider increasing the number of redirects to follow; Current value is: %s.", redirectCount, maxRedirects)); } RedisClusterNode nodeToUse = lookupNode(node); S client = this.resourceProvider.getResourceForSpecificNode(nodeToUse); - Assert.notNull(client, "Could not acquire resource for node. Is your cluster info up to date?"); + Assert.notNull(client, "Could not acquire resource for node; Is your cluster info up to date"); try { return new NodeResult<>(node, cmd.doInCluster(client)); @@ -188,8 +188,8 @@ public class ClusterCommandExecutor implements DisposableBean { public MultiNodeResult executeCommandAsyncOnNodes(ClusterCommandCallback callback, Iterable nodes) { - Assert.notNull(callback, "Callback must not be null!"); - Assert.notNull(nodes, "Nodes must not be null!"); + Assert.notNull(callback, "Callback must not be null"); + Assert.notNull(nodes, "Nodes must not be null"); List resolvedRedisClusterNodes = new ArrayList<>(); ClusterTopology topology = topologyProvider.getTopology(); @@ -305,12 +305,12 @@ public class ClusterCommandExecutor implements DisposableBean { private NodeResult executeMultiKeyCommandOnSingleNode(MultiKeyClusterCommandCallback cmd, RedisClusterNode node, byte[] key) { - Assert.notNull(cmd, "MultiKeyCommandCallback must not be null!"); - Assert.notNull(node, "RedisClusterNode must not be null!"); - Assert.notNull(key, "Keys for execution must not be null!"); + Assert.notNull(cmd, "MultiKeyCommandCallback must not be null"); + Assert.notNull(node, "RedisClusterNode must not be null"); + Assert.notNull(key, "Keys for execution must not be null"); S client = this.resourceProvider.getResourceForSpecificNode(node); - Assert.notNull(client, "Could not acquire resource for node. Is your cluster info up to date?"); + Assert.notNull(client, "Could not acquire resource for node; Is your cluster info up to date"); try { return new NodeResult<>(node, cmd.doInCluster(client, key), key); @@ -497,7 +497,7 @@ public class ClusterCommandExecutor implements DisposableBean { @Nullable public U mapValue(Function mapper) { - Assert.notNull(mapper, "Mapper function must not be null!"); + Assert.notNull(mapper, "Mapper function must not be null"); return mapper.apply(getValue()); } diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterInfo.java b/src/main/java/org/springframework/data/redis/connection/ClusterInfo.java index e530bf71c..183fdcf93 100644 --- a/src/main/java/org/springframework/data/redis/connection/ClusterInfo.java +++ b/src/main/java/org/springframework/data/redis/connection/ClusterInfo.java @@ -52,7 +52,7 @@ public class ClusterInfo { */ public ClusterInfo(Properties clusterProperties) { - Assert.notNull(clusterProperties, "ClusterProperties must not be null!"); + Assert.notNull(clusterProperties, "ClusterProperties must not be null"); this.clusterProperties = clusterProperties; } @@ -153,7 +153,7 @@ public class ClusterInfo { @Nullable public String get(Info info) { - Assert.notNull(info, "Cannot retrieve cluster information for 'null'."); + Assert.notNull(info, "Cannot retrieve cluster information for 'null'"); return get(info.key); } diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java b/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java index 643b92653..19c207a3b 100644 --- a/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java +++ b/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java @@ -64,7 +64,7 @@ public final class ClusterSlotHashUtil { */ public static boolean isSameSlotForAllKeys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); if (keys.size() <= 1) { return true; @@ -83,7 +83,7 @@ public final class ClusterSlotHashUtil { */ public static boolean isSameSlotForAllKeys(ByteBuffer... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return isSameSlotForAllKeys(Arrays.asList(keys)); } @@ -93,7 +93,7 @@ public final class ClusterSlotHashUtil { */ public static boolean isSameSlotForAllKeys(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); if (keys.length <= 1) { return true; @@ -116,7 +116,7 @@ public final class ClusterSlotHashUtil { */ public static int calculateSlot(String key) { - Assert.hasText(key, "Key must not be null or empty!"); + Assert.hasText(key, "Key must not be null or empty"); return calculateSlot(key.getBytes()); } @@ -128,7 +128,7 @@ public final class ClusterSlotHashUtil { */ public static int calculateSlot(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); byte[] finalKey = key; int start = indexOf(key, SUBKEY_START); diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterTopology.java b/src/main/java/org/springframework/data/redis/connection/ClusterTopology.java index ac5b218d3..9a62bf25b 100644 --- a/src/main/java/org/springframework/data/redis/connection/ClusterTopology.java +++ b/src/main/java/org/springframework/data/redis/connection/ClusterTopology.java @@ -130,7 +130,7 @@ public class ClusterTopology { */ public RedisClusterNode getKeyServingMasterNode(byte[] key) { - Assert.notNull(key, "Key for node lookup must not be null!"); + Assert.notNull(key, "Key for node lookup must not be null"); int slot = ClusterSlotHashUtil.calculateSlot(key); @@ -161,7 +161,7 @@ public class ClusterTopology { } throw new ClusterStateFailureException( - String.format("Could not find node at %s:%s. Is your cluster info up to date?", host, port)); + String.format("Could not find node at %s:%s; Is your cluster info up to date", host, port)); } /** @@ -173,7 +173,7 @@ public class ClusterTopology { */ public RedisClusterNode lookup(String nodeId) { - Assert.notNull(nodeId, "NodeId must not be null!"); + Assert.notNull(nodeId, "NodeId must not be null"); for (RedisClusterNode node : nodes) { if (nodeId.equals(node.getId())) { @@ -182,7 +182,7 @@ public class ClusterTopology { } throw new ClusterStateFailureException( - String.format("Could not find node at %s. Is your cluster info up to date?", nodeId)); + String.format("Could not find node at %s; Is your cluster info up to date", nodeId)); } /** @@ -195,7 +195,7 @@ public class ClusterTopology { */ public RedisClusterNode lookup(RedisClusterNode node) { - Assert.notNull(node, "RedisClusterNode must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); if (nodes.contains(node) && node.hasValidHost() && StringUtils.hasText(node.getId())) { return node; @@ -210,7 +210,7 @@ public class ClusterTopology { } throw new ClusterStateFailureException( - String.format("Could not find node at %s. Have you provided either host and port or the nodeId?", node)); + String.format("Could not find node at %s; Have you provided either host and port or the nodeId", node)); } /** diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java b/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java index 8d2a04e61..04eff27aa 100644 --- a/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java @@ -34,8 +34,8 @@ public class DefaultMessage implements Message { public DefaultMessage(byte[] channel, byte[] body) { - Assert.notNull(channel, "Channel must not be null!"); - Assert.notNull(body, "Body must not be null!"); + Assert.notNull(channel, "Channel must not be null"); + Assert.notNull(body, "Body must not be null"); this.body = body; this.channel = channel; diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java index 25cbb33df..fea526f77 100644 --- a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java @@ -2271,7 +2271,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco @Override public Long geoAdd(String key, GeoLocation location) { - Assert.notNull(location, "Location must not be null!"); + Assert.notNull(location, "Location must not be null"); return geoAdd(key, location.getPoint(), location.getName()); } @@ -2288,7 +2288,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco @Override public Long geoAdd(String key, Map memberCoordinateMap) { - Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!"); + Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null"); Map byteMap = new HashMap<>(); for (Entry entry : memberCoordinateMap.entrySet()) { @@ -2301,7 +2301,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco @Override public Long geoAdd(String key, Iterable> locations) { - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(locations, "Locations must not be null"); Map byteMap = new HashMap<>(); for (GeoLocation location : locations) { @@ -3011,7 +3011,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco } if (results.size() != converters.size()) { // Some of the commands were done directly on the delegate, don't attempt to convert - log.warn("Delegate returned an unexpected number of results. Abandoning type conversion."); + log.warn("Delegate returned an unexpected number of results; Abandoning type conversion."); return results; } List convertedResults = new ArrayList<>(results.size()); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java index 022e7ce99..d9204381e 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java @@ -80,7 +80,7 @@ public interface ReactiveGeoCommands { */ public static GeoAddCommand location(GeoLocation geoLocation) { - Assert.notNull(geoLocation, "GeoLocation must not be null!"); + Assert.notNull(geoLocation, "GeoLocation must not be null"); return new GeoAddCommand(null, Collections.singletonList(geoLocation)); } @@ -93,7 +93,7 @@ public interface ReactiveGeoCommands { */ public static GeoAddCommand locations(Collection> geoLocations) { - Assert.notNull(geoLocations, "GeoLocations must not be null!"); + Assert.notNull(geoLocations, "GeoLocations must not be null"); return new GeoAddCommand(null, new ArrayList<>(geoLocations)); } @@ -127,9 +127,9 @@ public interface ReactiveGeoCommands { */ default Mono geoAdd(ByteBuffer key, Point point, ByteBuffer member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(point, "Point must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(point, "Point must not be null"); + Assert.notNull(member, "Member must not be null"); return geoAdd(key, new GeoLocation<>(member, point)); } @@ -144,8 +144,8 @@ public interface ReactiveGeoCommands { */ default Mono geoAdd(ByteBuffer key, GeoLocation location) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(location, "Location must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(location, "Location must not be null"); return geoAdd(key, Collections.singletonList(location)); } @@ -160,8 +160,8 @@ public interface ReactiveGeoCommands { */ default Mono geoAdd(ByteBuffer key, Collection> locations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(locations, "Locations must not be null"); return geoAdd(Mono.just(GeoAddCommand.locations(locations).to(key))).next().map(NumericResponse::getOutput); } @@ -245,7 +245,7 @@ public interface ReactiveGeoCommands { */ public GeoDistCommand between(ByteBuffer from) { - Assert.notNull(from, "From member must not be null!"); + Assert.notNull(from, "From member must not be null"); return new GeoDistCommand(getKey(), from, to, metric); } @@ -272,7 +272,7 @@ public interface ReactiveGeoCommands { */ public GeoDistCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoDistCommand(key, from, to, metric); } @@ -326,10 +326,10 @@ public interface ReactiveGeoCommands { */ default Mono geoDist(ByteBuffer key, ByteBuffer from, ByteBuffer to, Metric metric) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(from, "From must not be null!"); - Assert.notNull(to, "To must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(from, "From must not be null"); + Assert.notNull(to, "To must not be null"); + Assert.notNull(metric, "Metric must not be null"); return geoDist(Mono.just(GeoDistCommand.units(metric).between(from).and(to).forKey(key))) // .next() // @@ -370,7 +370,7 @@ public interface ReactiveGeoCommands { */ public static GeoHashCommand member(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new GeoHashCommand(null, Collections.singletonList(member)); } @@ -383,7 +383,7 @@ public interface ReactiveGeoCommands { */ public static GeoHashCommand members(Collection members) { - Assert.notNull(members, "Members must not be null!"); + Assert.notNull(members, "Members must not be null"); return new GeoHashCommand(null, new ArrayList<>(members)); } @@ -396,7 +396,7 @@ public interface ReactiveGeoCommands { */ public GeoHashCommand of(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoHashCommand(key, members); } @@ -419,7 +419,7 @@ public interface ReactiveGeoCommands { */ default Mono geoHash(ByteBuffer key, ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return geoHash(key, Collections.singletonList(member)) // .flatMap(vals -> vals.isEmpty() ? Mono.empty() : Mono.justOrEmpty(vals.iterator().next())); @@ -435,8 +435,8 @@ public interface ReactiveGeoCommands { */ default Mono> geoHash(ByteBuffer key, Collection members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); return geoHash(Mono.just(GeoHashCommand.members(members).of(key))) // .next() // @@ -477,7 +477,7 @@ public interface ReactiveGeoCommands { */ public static GeoPosCommand member(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new GeoPosCommand(null, Collections.singletonList(member)); } @@ -490,7 +490,7 @@ public interface ReactiveGeoCommands { */ public static GeoPosCommand members(Collection members) { - Assert.notNull(members, "Members must not be null!"); + Assert.notNull(members, "Members must not be null"); return new GeoPosCommand(null, new ArrayList<>(members)); } @@ -503,7 +503,7 @@ public interface ReactiveGeoCommands { */ public GeoPosCommand of(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoPosCommand(key, members); } @@ -526,7 +526,7 @@ public interface ReactiveGeoCommands { */ default Mono geoPos(ByteBuffer key, ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return geoPos(key, Collections.singletonList(member)) .flatMap(vals -> vals.isEmpty() ? Mono.empty() : Mono.justOrEmpty(vals.iterator().next())); @@ -542,8 +542,8 @@ public interface ReactiveGeoCommands { */ default Mono> geoPos(ByteBuffer key, Collection members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); return geoPos(Mono.just(GeoPosCommand.members(members).of(key))).next().map(MultiValueResponse::getOutput); } @@ -591,7 +591,7 @@ public interface ReactiveGeoCommands { */ public static GeoRadiusCommand within(Distance distance) { - Assert.notNull(distance, "Distance must not be null!"); + Assert.notNull(distance, "Distance must not be null"); return new GeoRadiusCommand(null, null, distance, GeoRadiusCommandArgs.newGeoRadiusArgs(), null, null); } @@ -644,7 +644,7 @@ public interface ReactiveGeoCommands { */ public static GeoRadiusCommand within(Circle circle) { - Assert.notNull(circle, "Circle must not be null!"); + Assert.notNull(circle, "Circle must not be null"); return within(circle.getRadius()).from(circle.getCenter()); } @@ -658,7 +658,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand from(Point center) { - Assert.notNull(center, "Center point must not be null!"); + Assert.notNull(center, "Center point must not be null"); return new GeoRadiusCommand(getKey(), center, distance, args, store, storeDist); } @@ -671,7 +671,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand withFlag(Flag flag) { - Assert.notNull(flag, "Flag must not be null!"); + Assert.notNull(flag, "Flag must not be null"); GeoRadiusCommandArgs args = cloneArgs(); args.getFlags().add(flag); @@ -706,7 +706,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand withArgs(GeoRadiusCommandArgs args) { - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(args, "Args must not be null"); return new GeoRadiusCommand(getKey(), point, distance, args == null ? GeoRadiusCommandArgs.newGeoRadiusArgs() : args, store, storeDist); } @@ -734,7 +734,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand sort(Direction direction) { - Assert.notNull(direction, "Direction must not be null!"); + Assert.notNull(direction, "Direction must not be null"); GeoRadiusCommandArgs args = cloneArgs(); args.sort(direction); @@ -768,7 +768,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusCommand(key, point, distance, args, store, storeDist); } @@ -781,7 +781,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand storeAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusCommand(getKey(), point, distance, args, key, storeDist); } @@ -793,7 +793,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusCommand storeDistAt(@Nullable ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusCommand(getKey(), point, distance, args, store, key); } @@ -888,9 +888,9 @@ public interface ReactiveGeoCommands { default Flux>> geoRadius(ByteBuffer key, Circle circle, GeoRadiusCommandArgs geoRadiusArgs) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(circle, "Circle must not be null!"); - Assert.notNull(geoRadiusArgs, "GeoRadiusArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(circle, "Circle must not be null"); + Assert.notNull(geoRadiusArgs, "GeoRadiusArgs must not be null"); return geoRadius(Mono.just(GeoRadiusCommand.within(circle).withArgs(geoRadiusArgs).forKey(key))) .flatMap(CommandResponse::getOutput); @@ -940,7 +940,7 @@ public interface ReactiveGeoCommands { */ public static GeoRadiusByMemberCommand within(Distance distance) { - Assert.notNull(distance, "Distance must not be null!"); + Assert.notNull(distance, "Distance must not be null"); return new GeoRadiusByMemberCommand(null, null, distance, GeoRadiusCommandArgs.newGeoRadiusArgs(), null, null); } @@ -993,7 +993,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand from(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new GeoRadiusByMemberCommand(getKey(), member, distance, args, store, storeDist); } @@ -1006,7 +1006,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand withFlag(Flag flag) { - Assert.notNull(flag, "Flag must not be null!"); + Assert.notNull(flag, "Flag must not be null"); GeoRadiusCommandArgs args = cloneArgs(); args.getFlags().add(flag); @@ -1041,7 +1041,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand withArgs(GeoRadiusCommandArgs args) { - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(args, "Args must not be null"); return new GeoRadiusByMemberCommand(getKey(), member, distance, args, store, storeDist); } @@ -1068,7 +1068,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand sort(Direction direction) { - Assert.notNull(direction, "Direction must not be null!"); + Assert.notNull(direction, "Direction must not be null"); GeoRadiusCommandArgs args = cloneArgs(); args.sort(direction); @@ -1102,7 +1102,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusByMemberCommand(key, member, distance, args, store, storeDist); } @@ -1114,7 +1114,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand storeAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusByMemberCommand(getKey(), member, distance, args, key, storeDist); } @@ -1126,7 +1126,7 @@ public interface ReactiveGeoCommands { */ public GeoRadiusByMemberCommand storeDistAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoRadiusByMemberCommand(getKey(), member, distance, args, store, key); } @@ -1222,10 +1222,10 @@ public interface ReactiveGeoCommands { default Flux>> geoRadiusByMember(ByteBuffer key, ByteBuffer member, Distance distance, GeoRadiusCommandArgs geoRadiusArgs) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(distance, "Distance must not be null!"); - Assert.notNull(geoRadiusArgs, "GeoRadiusArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(distance, "Distance must not be null"); + Assert.notNull(geoRadiusArgs, "GeoRadiusArgs must not be null"); return geoRadiusByMember( Mono.just(GeoRadiusByMemberCommand.within(distance).from(member).forKey(key).withArgs(geoRadiusArgs))) @@ -1271,7 +1271,7 @@ public interface ReactiveGeoCommands { */ public static GeoSearchCommand within(GeoShape shape) { - Assert.notNull(shape, "GeoShape must not be null!"); + Assert.notNull(shape, "GeoShape must not be null"); return new GeoSearchCommand(null, null, shape, null); } @@ -1284,7 +1284,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchCommand at(GeoReference reference) { - Assert.notNull(reference, "GeoReference must not be null!"); + Assert.notNull(reference, "GeoReference must not be null"); return new GeoSearchCommand(getKey(), reference, getShape(), args); } @@ -1297,7 +1297,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchCommand in(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoSearchCommand(key, getReference(), getShape(), args); } @@ -1310,7 +1310,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchCommand with(GeoSearchCommandArgs args) { - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(args, "Args must not be null"); return new GeoSearchCommand(getKey(), getReference(), getShape(), args); } @@ -1362,7 +1362,7 @@ public interface ReactiveGeoCommands { */ public static GeoSearchStoreCommand within(GeoShape shape) { - Assert.notNull(shape, "GeoShape must not be null!"); + Assert.notNull(shape, "GeoShape must not be null"); return new GeoSearchStoreCommand(null, null, null, shape, null); } @@ -1375,7 +1375,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchStoreCommand at(GeoReference reference) { - Assert.notNull(reference, "GeoReference must not be null!"); + Assert.notNull(reference, "GeoReference must not be null"); return new GeoSearchStoreCommand(getKey(), getDestKey(), reference, getShape(), args); } @@ -1388,7 +1388,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchStoreCommand in(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GeoSearchStoreCommand(key, getDestKey(), getReference(), getShape(), args); } @@ -1401,7 +1401,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchStoreCommand storeAt(ByteBuffer destKey) { - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(destKey, "Destination key must not be null"); return new GeoSearchStoreCommand(getKey(), destKey, getReference(), getShape(), args); } @@ -1414,7 +1414,7 @@ public interface ReactiveGeoCommands { */ public GeoSearchStoreCommand with(GeoSearchStoreCommandArgs args) { - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(args, "Args must not be null"); return new GeoSearchStoreCommand(getKey(), getDestKey(), getReference(), getShape(), args); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveHashCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveHashCommands.java index 340e36ebe..084395b1d 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveHashCommands.java @@ -76,7 +76,7 @@ public interface ReactiveHashCommands { */ public static HSetCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new HSetCommand(null, Collections.singletonMap(SINGLE_VALUE_KEY, value), Boolean.TRUE); } @@ -89,7 +89,7 @@ public interface ReactiveHashCommands { */ public static HSetCommand fieldValues(Map fieldValueMap) { - Assert.notNull(fieldValueMap, "Field values map must not be null!"); + Assert.notNull(fieldValueMap, "Field values map must not be null"); return new HSetCommand(null, fieldValueMap, Boolean.TRUE); } @@ -106,7 +106,7 @@ public interface ReactiveHashCommands { throw new InvalidDataAccessApiUsageException("Value has not been set."); } - Assert.notNull(field, "Field not be null!"); + Assert.notNull(field, "Field not be null"); return new HSetCommand(getKey(), Collections.singletonMap(field, fieldValueMap.get(SINGLE_VALUE_KEY)), upsert); } @@ -119,7 +119,7 @@ public interface ReactiveHashCommands { */ public HSetCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key not be null!"); + Assert.notNull(key, "Key not be null"); return new HSetCommand(key, fieldValueMap, upsert); } @@ -159,9 +159,9 @@ public interface ReactiveHashCommands { */ default Mono hSet(ByteBuffer key, ByteBuffer field, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return hSet(Mono.just(HSetCommand.value(value).ofField(field).forKey(key))).next().map(BooleanResponse::getOutput); } @@ -177,9 +177,9 @@ public interface ReactiveHashCommands { */ default Mono hSetNX(ByteBuffer key, ByteBuffer field, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return hSet(Mono.just(HSetCommand.value(value).ofField(field).forKey(key).ifValueNotExists())).next() .map(BooleanResponse::getOutput); @@ -195,8 +195,8 @@ public interface ReactiveHashCommands { */ default Mono hMSet(ByteBuffer key, Map fieldValueMap) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fieldValueMap, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fieldValueMap, "Field must not be null"); return hSet(Mono.just(HSetCommand.fieldValues(fieldValueMap).forKey(key))).next().map(it -> true); } @@ -235,7 +235,7 @@ public interface ReactiveHashCommands { */ public static HGetCommand field(ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new HGetCommand(null, Collections.singletonList(field)); } @@ -248,7 +248,7 @@ public interface ReactiveHashCommands { */ public static HGetCommand fields(Collection fields) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); return new HGetCommand(null, new ArrayList<>(fields)); } @@ -261,7 +261,7 @@ public interface ReactiveHashCommands { */ public HGetCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new HGetCommand(key, fields); } @@ -297,8 +297,8 @@ public interface ReactiveHashCommands { */ default Mono> hMGet(ByteBuffer key, Collection fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return hMGet(Mono.just(HGetCommand.fields(fields).from(key))).next().map(MultiValueResponse::getOutput); } @@ -337,7 +337,7 @@ public interface ReactiveHashCommands { */ public static HExistsCommand field(ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new HExistsCommand(null, field); } @@ -350,7 +350,7 @@ public interface ReactiveHashCommands { */ public HExistsCommand in(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new HExistsCommand(key, field); } @@ -373,8 +373,8 @@ public interface ReactiveHashCommands { */ default Mono hExists(ByteBuffer key, ByteBuffer field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return hExists(Mono.just(HExistsCommand.field(field).in(key))).next().map(BooleanResponse::getOutput); } @@ -411,7 +411,7 @@ public interface ReactiveHashCommands { */ public static HDelCommand field(ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new HDelCommand(null, Collections.singletonList(field)); } @@ -424,7 +424,7 @@ public interface ReactiveHashCommands { */ public static HDelCommand fields(Collection fields) { - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(fields, "Fields must not be null"); return new HDelCommand(null, new ArrayList<>(fields)); } @@ -437,7 +437,7 @@ public interface ReactiveHashCommands { */ public HDelCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new HDelCommand(key, fields); } @@ -460,7 +460,7 @@ public interface ReactiveHashCommands { */ default Mono hDel(ByteBuffer key, ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return hDel(key, Collections.singletonList(field)).map(val -> val > 0 ? Boolean.TRUE : Boolean.FALSE); } @@ -475,8 +475,8 @@ public interface ReactiveHashCommands { */ default Mono hDel(ByteBuffer key, Collection fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return hDel(Mono.just(HDelCommand.fields(fields).from(key))).next().map(NumericResponse::getOutput); } @@ -499,7 +499,7 @@ public interface ReactiveHashCommands { */ default Mono hLen(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hLen(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -539,7 +539,7 @@ public interface ReactiveHashCommands { */ public static HRandFieldCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new HRandFieldCommand(key, 1); } @@ -572,7 +572,7 @@ public interface ReactiveHashCommands { */ default Mono hRandField(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hRandField(Mono.just(HRandFieldCommand.key(key).count(1))).flatMap(CommandResponse::getOutput).next(); } @@ -587,7 +587,7 @@ public interface ReactiveHashCommands { */ default Mono> hRandFieldWithValues(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hRandFieldWithValues(Mono.just(HRandFieldCommand.key(key).count(1))).flatMap(CommandResponse::getOutput) .next(); @@ -607,7 +607,7 @@ public interface ReactiveHashCommands { */ default Flux hRandField(ByteBuffer key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hRandField(Mono.just(HRandFieldCommand.key(key).count(count))).flatMap(CommandResponse::getOutput); } @@ -626,7 +626,7 @@ public interface ReactiveHashCommands { */ default Flux> hRandFieldWithValues(ByteBuffer key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hRandFieldWithValues(Mono.just(HRandFieldCommand.key(key).count(count))).flatMap(CommandResponse::getOutput); } @@ -661,7 +661,7 @@ public interface ReactiveHashCommands { */ default Flux hKeys(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hKeys(Mono.just(new KeyCommand(key))).flatMap(CommandResponse::getOutput); } @@ -684,7 +684,7 @@ public interface ReactiveHashCommands { */ default Flux hVals(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hVals(Mono.just(new KeyCommand(key))).flatMap(CommandResponse::getOutput); } @@ -707,7 +707,7 @@ public interface ReactiveHashCommands { */ default Flux> hGetAll(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return hGetAll(Mono.just(new KeyCommand(key))).flatMap(CommandResponse::getOutput); } @@ -792,7 +792,7 @@ public interface ReactiveHashCommands { */ public static HStrLenCommand lengthOf(ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new HStrLenCommand(null, field); } @@ -825,8 +825,8 @@ public interface ReactiveHashCommands { */ default Mono hStrLen(ByteBuffer key, ByteBuffer field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return hStrLen(Mono.just(HStrLenCommand.lengthOf(field).from(key))).next().map(NumericResponse::getOutput); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveHyperLogLogCommands.java index ad3fecd93..c37e1dea4 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveHyperLogLogCommands.java @@ -64,7 +64,7 @@ public interface ReactiveHyperLogLogCommands { */ public static PfAddCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return values(Collections.singletonList(value)); } @@ -77,7 +77,7 @@ public interface ReactiveHyperLogLogCommands { */ public static PfAddCommand values(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new PfAddCommand(null, new ArrayList<>(values)); } @@ -90,7 +90,7 @@ public interface ReactiveHyperLogLogCommands { */ public PfAddCommand to(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new PfAddCommand(key, values); } @@ -113,7 +113,7 @@ public interface ReactiveHyperLogLogCommands { */ default Mono pfAdd(ByteBuffer key, ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return pfAdd(key, Collections.singletonList(value)); } @@ -128,8 +128,8 @@ public interface ReactiveHyperLogLogCommands { */ default Mono pfAdd(ByteBuffer key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return pfAdd(Mono.just(PfAddCommand.values(values).to(key))).next().map(NumericResponse::getOutput); } @@ -167,7 +167,7 @@ public interface ReactiveHyperLogLogCommands { */ public static PfCountCommand valueIn(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return valuesIn(Collections.singletonList(key)); } @@ -180,7 +180,7 @@ public interface ReactiveHyperLogLogCommands { */ public static PfCountCommand valuesIn(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new PfCountCommand(new ArrayList<>(keys)); } @@ -207,7 +207,7 @@ public interface ReactiveHyperLogLogCommands { */ default Mono pfCount(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return pfCount(Collections.singletonList(key)); } @@ -221,7 +221,7 @@ public interface ReactiveHyperLogLogCommands { */ default Mono pfCount(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return pfCount(Mono.just(PfCountCommand.valuesIn(keys))).next().map(NumericResponse::getOutput); } @@ -259,7 +259,7 @@ public interface ReactiveHyperLogLogCommands { */ public static PfMergeCommand valuesIn(Collection sourceKeys) { - Assert.notNull(sourceKeys, "Source keys must not be null!"); + Assert.notNull(sourceKeys, "Source keys must not be null"); return new PfMergeCommand(null, new ArrayList<>(sourceKeys)); } @@ -273,7 +273,7 @@ public interface ReactiveHyperLogLogCommands { */ public PfMergeCommand into(ByteBuffer destinationKey) { - Assert.notNull(destinationKey, "Destination key must not be null!"); + Assert.notNull(destinationKey, "Destination key must not be null"); return new PfMergeCommand(destinationKey, sourceKeys); } @@ -296,8 +296,8 @@ public interface ReactiveHyperLogLogCommands { */ default Mono pfMerge(ByteBuffer destinationKey, Collection sourceKeys) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sourceKeys, "SourceKeys must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sourceKeys, "SourceKeys must not be null"); return pfMerge(Mono.just(PfMergeCommand.valuesIn(sourceKeys).into(destinationKey))).next() .map(BooleanResponse::getOutput); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java index 3ab7d99d4..87468fb80 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java @@ -71,7 +71,7 @@ public interface ReactiveKeyCommands { */ public static CopyCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new CopyCommand(key, null, false, null); } @@ -85,7 +85,7 @@ public interface ReactiveKeyCommands { */ public CopyCommand to(ByteBuffer targetKey) { - Assert.notNull(targetKey, "Key must not be null!"); + Assert.notNull(targetKey, "Key must not be null"); return new CopyCommand(getKey(), targetKey, isReplace(), database); } @@ -145,8 +145,8 @@ public interface ReactiveKeyCommands { */ default Mono copy(ByteBuffer sourceKey, ByteBuffer targetKey, boolean replace) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Targetk ey must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Targetk ey must not be null"); return copy(Mono.just(CopyCommand.key(sourceKey).to(targetKey).replace(replace))).next() .map(BooleanResponse::getOutput); @@ -171,7 +171,7 @@ public interface ReactiveKeyCommands { */ default Mono exists(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return exists(Mono.just(new KeyCommand(key))).next().map(BooleanResponse::getOutput); } @@ -194,7 +194,7 @@ public interface ReactiveKeyCommands { */ default Mono type(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return type(Mono.just(new KeyCommand(key))).next().map(CommandResponse::getOutput); } @@ -241,7 +241,7 @@ public interface ReactiveKeyCommands { */ default Mono> keys(ByteBuffer pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return keys(Mono.just(pattern)).next().map(MultiValueResponse::getOutput); } @@ -328,7 +328,7 @@ public interface ReactiveKeyCommands { */ public static RenameCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new RenameCommand(key, null); } @@ -341,7 +341,7 @@ public interface ReactiveKeyCommands { */ public RenameCommand to(ByteBuffer newKey) { - Assert.notNull(newKey, "New key name must not be null!"); + Assert.notNull(newKey, "New key name must not be null"); return new RenameCommand(getKey(), newKey); } @@ -366,7 +366,7 @@ public interface ReactiveKeyCommands { */ default Mono rename(ByteBuffer oldKey, ByteBuffer newKey) { - Assert.notNull(oldKey, "Key must not be null!"); + Assert.notNull(oldKey, "Key must not be null"); return rename(Mono.just(RenameCommand.key(oldKey).to(newKey))).next().map(BooleanResponse::getOutput); } @@ -390,7 +390,7 @@ public interface ReactiveKeyCommands { */ default Mono renameNX(ByteBuffer key, ByteBuffer newKey) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return renameNX(Mono.just(RenameCommand.key(key).to(newKey))).next().map(BooleanResponse::getOutput); } @@ -413,7 +413,7 @@ public interface ReactiveKeyCommands { */ default Mono del(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return del(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -436,7 +436,7 @@ public interface ReactiveKeyCommands { */ default Mono mDel(List keys) { - Assert.notEmpty(keys, "Keys must not be empty or null!"); + Assert.notEmpty(keys, "Keys must not be empty or null"); return mDel(Mono.just(keys)).next().map(NumericResponse::getOutput); } @@ -461,7 +461,7 @@ public interface ReactiveKeyCommands { */ default Mono unlink(ByteBuffer key) { - Assert.notNull(key, "Keys must not be null!"); + Assert.notNull(key, "Keys must not be null"); return unlink(Mono.just(key).map(KeyCommand::new)).next().map(NumericResponse::getOutput); } @@ -488,7 +488,7 @@ public interface ReactiveKeyCommands { */ default Mono mUnlink(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return mUnlink(Mono.just(keys)).next().map(NumericResponse::getOutput); } @@ -530,7 +530,7 @@ public interface ReactiveKeyCommands { */ public static ExpireCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ExpireCommand(key, null); } @@ -543,7 +543,7 @@ public interface ReactiveKeyCommands { */ public ExpireCommand timeout(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return new ExpireCommand(getKey(), timeout); } @@ -567,8 +567,8 @@ public interface ReactiveKeyCommands { */ default Mono expire(ByteBuffer key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return expire(Mono.just(new ExpireCommand(key, timeout))).next().map(BooleanResponse::getOutput); } @@ -593,8 +593,8 @@ public interface ReactiveKeyCommands { */ default Mono pExpire(ByteBuffer key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return pExpire(Mono.just(new ExpireCommand(key, timeout))).next().map(BooleanResponse::getOutput); } @@ -635,7 +635,7 @@ public interface ReactiveKeyCommands { */ public static ExpireAtCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ExpireAtCommand(key, null); } @@ -648,7 +648,7 @@ public interface ReactiveKeyCommands { */ public ExpireAtCommand timeout(Instant expireAt) { - Assert.notNull(expireAt, "Expire at must not be null!"); + Assert.notNull(expireAt, "Expire at must not be null"); return new ExpireAtCommand(getKey(), expireAt); } @@ -672,8 +672,8 @@ public interface ReactiveKeyCommands { */ default Mono expireAt(ByteBuffer key, Instant expireAt) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expireAt, "Expire at must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expireAt, "Expire at must not be null"); return expireAt(Mono.just(new ExpireAtCommand(key, expireAt))).next().map(BooleanResponse::getOutput); } @@ -698,8 +698,8 @@ public interface ReactiveKeyCommands { */ default Mono pExpireAt(ByteBuffer key, Instant expireAt) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expireAt, "Expire at must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expireAt, "Expire at must not be null"); return pExpireAt(Mono.just(new ExpireAtCommand(key, expireAt))).next().map(BooleanResponse::getOutput); } @@ -723,7 +723,7 @@ public interface ReactiveKeyCommands { */ default Mono persist(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return persist(Mono.just(new KeyCommand(key))).next().map(BooleanResponse::getOutput); } @@ -746,7 +746,7 @@ public interface ReactiveKeyCommands { */ default Mono ttl(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return ttl(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -769,7 +769,7 @@ public interface ReactiveKeyCommands { */ default Mono pTtl(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return pTtl(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -808,7 +808,7 @@ public interface ReactiveKeyCommands { */ public static MoveCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new MoveCommand(key, null); } @@ -842,7 +842,7 @@ public interface ReactiveKeyCommands { */ default Mono move(ByteBuffer key, int database) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return move(Mono.just(new MoveCommand(key, database))).next().map(BooleanResponse::getOutput); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveListCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveListCommands.java index b1e4acba0..254a65a3b 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveListCommands.java @@ -123,7 +123,7 @@ public interface ReactiveListCommands { */ public PushCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new PushCommand(null, Collections.singletonList(value), direction, upsert); } @@ -136,7 +136,7 @@ public interface ReactiveListCommands { */ public PushCommand values(List values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new PushCommand(null, new ArrayList<>(values), direction, upsert); } @@ -149,7 +149,7 @@ public interface ReactiveListCommands { */ public PushCommand to(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new PushCommand(key, values, direction, upsert); } @@ -195,8 +195,8 @@ public interface ReactiveListCommands { */ default Mono rPush(ByteBuffer key, List values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return push(Mono.just(PushCommand.right().values(values).to(key))).next().map(NumericResponse::getOutput); } @@ -211,8 +211,8 @@ public interface ReactiveListCommands { */ default Mono rPushX(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return push(Mono.just(PushCommand.right().value(value).to(key).ifExists())).next().map(NumericResponse::getOutput); } @@ -227,8 +227,8 @@ public interface ReactiveListCommands { */ default Mono lPush(ByteBuffer key, List values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return push(Mono.just(PushCommand.left().values(values).to(key))).next().map(NumericResponse::getOutput); } @@ -243,8 +243,8 @@ public interface ReactiveListCommands { */ default Mono lPushX(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return push(Mono.just(PushCommand.left().value(value).to(key).ifExists())).next().map(NumericResponse::getOutput); } @@ -268,7 +268,7 @@ public interface ReactiveListCommands { */ default Mono lLen(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return lLen(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -293,7 +293,7 @@ public interface ReactiveListCommands { */ default Flux lRange(ByteBuffer key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return lRange(Mono.just(RangeCommand.key(key).fromIndex(start).toIndex(end))).flatMap(CommandResponse::getOutput); } @@ -318,7 +318,7 @@ public interface ReactiveListCommands { */ default Mono lTrim(ByteBuffer key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return lTrim(Mono.just(RangeCommand.key(key).fromIndex(start).toIndex(end))) // .next() // @@ -373,7 +373,7 @@ public interface ReactiveListCommands { */ public LPosCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new LPosCommand(key, element, count, rank); } @@ -426,7 +426,7 @@ public interface ReactiveListCommands { */ default Mono lPos(ByteBuffer key, ByteBuffer element) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return lPos(LPosCommand.lPosOf(element).from(key)).next(); } @@ -487,7 +487,7 @@ public interface ReactiveListCommands { */ public LIndexCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new LIndexCommand(key, index); } @@ -510,7 +510,7 @@ public interface ReactiveListCommands { */ default Mono lIndex(ByteBuffer key, long index) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return lIndex(Mono.just(LIndexCommand.elementAt(index).from(key))).next().map(ByteBufferResponse::getOutput); } @@ -554,7 +554,7 @@ public interface ReactiveListCommands { */ public static LInsertCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new LInsertCommand(null, null, null, value); } @@ -567,7 +567,7 @@ public interface ReactiveListCommands { */ public LInsertCommand before(ByteBuffer pivot) { - Assert.notNull(pivot, "Before pivot must not be null!"); + Assert.notNull(pivot, "Before pivot must not be null"); return new LInsertCommand(getKey(), Position.BEFORE, pivot, value); } @@ -580,7 +580,7 @@ public interface ReactiveListCommands { */ public LInsertCommand after(ByteBuffer pivot) { - Assert.notNull(pivot, "After pivot must not be null!"); + Assert.notNull(pivot, "After pivot must not be null"); return new LInsertCommand(getKey(), Position.AFTER, pivot, value); } @@ -593,7 +593,7 @@ public interface ReactiveListCommands { */ public LInsertCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new LInsertCommand(key, position, pivot, value); } @@ -635,10 +635,10 @@ public interface ReactiveListCommands { */ default Mono lInsert(ByteBuffer key, Position position, ByteBuffer pivot, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(position, "Position must not be null!"); - Assert.notNull(pivot, "Pivot must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(position, "Position must not be null"); + Assert.notNull(pivot, "Pivot must not be null"); + Assert.notNull(value, "Value must not be null"); LInsertCommand command = LInsertCommand.value(value); command = Position.BEFORE.equals(position) ? command.before(pivot) : command.after(pivot); @@ -687,8 +687,8 @@ public interface ReactiveListCommands { */ public static LMoveCommand from(ByteBuffer sourceKey, Direction sourceDirection) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(sourceDirection, "Direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(sourceDirection, "Direction must not be null"); return new LMoveCommand(sourceKey, null, sourceDirection, null); } @@ -703,8 +703,8 @@ public interface ReactiveListCommands { */ public LMoveCommand to(ByteBuffer destinationKey, Direction direction) { - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(direction, "Direction must not be null!"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(direction, "Direction must not be null"); return new LMoveCommand(getKey(), destinationKey, from, direction); } @@ -718,7 +718,7 @@ public interface ReactiveListCommands { */ public BLMoveCommand timeout(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return new BLMoveCommand(getKey(), destinationKey, from, to, timeout); } @@ -777,10 +777,10 @@ public interface ReactiveListCommands { */ default Mono lMove(ByteBuffer sourceKey, ByteBuffer destinationKey, Direction from, Direction to) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return lMove(Mono.just(LMoveCommand.from(sourceKey, from).to(destinationKey, to))).map(CommandResponse::getOutput) .next(); @@ -815,12 +815,12 @@ public interface ReactiveListCommands { default Mono bLMove(ByteBuffer sourceKey, ByteBuffer destinationKey, Direction from, Direction to, Duration timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); - Assert.isTrue(!timeout.isNegative(), "Timeout must not be negative!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); + Assert.isTrue(!timeout.isNegative(), "Timeout must not be negative"); return bLMove(Mono.just(BLMoveCommand.from(sourceKey, from).to(destinationKey, to).timeout(timeout))) .map(CommandResponse::getOutput).next(); @@ -876,7 +876,7 @@ public interface ReactiveListCommands { */ public LSetCommand to(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new LSetCommand(getKey(), index, value); } @@ -889,7 +889,7 @@ public interface ReactiveListCommands { */ public LSetCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new LSetCommand(key, index, value); } @@ -921,8 +921,8 @@ public interface ReactiveListCommands { */ default Mono lSet(ByteBuffer key, long index, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return lSet(Mono.just(LSetCommand.elementAt(index).to(value).forKey(key))).next().map(BooleanResponse::getOutput); } @@ -992,7 +992,7 @@ public interface ReactiveListCommands { */ public LRemCommand occurrencesOf(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new LRemCommand(getKey(), count, value); } @@ -1005,7 +1005,7 @@ public interface ReactiveListCommands { */ public LRemCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new LRemCommand(key, count, value); } @@ -1036,8 +1036,8 @@ public interface ReactiveListCommands { */ default Mono lRem(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return lRem(Mono.just(LRemCommand.all().occurrencesOf(value).from(key))).next().map(NumericResponse::getOutput); } @@ -1053,9 +1053,9 @@ public interface ReactiveListCommands { */ default Mono lRem(ByteBuffer key, Long count, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(count, "Count must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(count, "Count must not be null"); + Assert.notNull(value, "Value must not be null"); return lRem(Mono.just(LRemCommand.first(count).occurrencesOf(value).from(key))).next() .map(NumericResponse::getOutput); @@ -1117,7 +1117,7 @@ public interface ReactiveListCommands { */ public PopCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new PopCommand(key, count, direction); } @@ -1154,7 +1154,7 @@ public interface ReactiveListCommands { */ default Mono lPop(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return pop(Mono.just(PopCommand.left().from(key))).next().map(ByteBufferResponse::getOutput); } @@ -1170,7 +1170,7 @@ public interface ReactiveListCommands { */ default Flux lPop(ByteBuffer key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return popList(Mono.just(PopCommand.left().from(key).count(count))).flatMap(CommandResponse::getOutput); } @@ -1184,7 +1184,7 @@ public interface ReactiveListCommands { */ default Mono rPop(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return pop(Mono.just(PopCommand.right().from(key))).next().map(ByteBufferResponse::getOutput); } @@ -1200,7 +1200,7 @@ public interface ReactiveListCommands { */ default Flux rPop(ByteBuffer key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return popList(Mono.just(PopCommand.right().from(key).count(count))).flatMap(CommandResponse::getOutput); } @@ -1269,7 +1269,7 @@ public interface ReactiveListCommands { */ public BPopCommand from(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new BPopCommand(new ArrayList<>(keys), Duration.ZERO, direction); } @@ -1282,7 +1282,7 @@ public interface ReactiveListCommands { */ public BPopCommand blockingFor(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return new BPopCommand(keys, timeout, direction); } @@ -1362,8 +1362,8 @@ public interface ReactiveListCommands { */ default Mono blPop(List keys, Duration timeout) { - Assert.notNull(keys, "Keys must not be null."); - Assert.notNull(timeout, "Timeout must not be null."); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return bPop(Mono.just(BPopCommand.left().from(keys).blockingFor(timeout))).next().map(PopResponse::getOutput); } @@ -1379,8 +1379,8 @@ public interface ReactiveListCommands { */ default Mono brPop(List keys, Duration timeout) { - Assert.notNull(keys, "Keys must not be null."); - Assert.notNull(timeout, "Timeout must not be null."); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return bPop(Mono.just(BPopCommand.right().from(keys).blockingFor(timeout))).next().map(PopResponse::getOutput); } @@ -1421,7 +1421,7 @@ public interface ReactiveListCommands { */ public static RPopLPushCommand from(ByteBuffer sourceKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); return new RPopLPushCommand(sourceKey, null); } @@ -1435,7 +1435,7 @@ public interface ReactiveListCommands { */ public RPopLPushCommand to(ByteBuffer destinationKey) { - Assert.notNull(destinationKey, "Destination key must not be null!"); + Assert.notNull(destinationKey, "Destination key must not be null"); return new RPopLPushCommand(getKey(), destinationKey); } @@ -1459,8 +1459,8 @@ public interface ReactiveListCommands { */ default Mono rPopLPush(ByteBuffer source, ByteBuffer destination) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(destination, "Destination must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(destination, "Destination must not be null"); return rPopLPush(Mono.just(RPopLPushCommand.from(source).to(destination))) // .next() // @@ -1504,7 +1504,7 @@ public interface ReactiveListCommands { */ public static BRPopLPushCommand from(ByteBuffer sourceKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); return new BRPopLPushCommand(sourceKey, null, Duration.ZERO); } @@ -1518,7 +1518,7 @@ public interface ReactiveListCommands { */ public BRPopLPushCommand to(ByteBuffer destinationKey) { - Assert.notNull(destinationKey, "Destination key must not be null!"); + Assert.notNull(destinationKey, "Destination key must not be null"); return new BRPopLPushCommand(getKey(), destinationKey, timeout); } @@ -1531,7 +1531,7 @@ public interface ReactiveListCommands { */ public BRPopLPushCommand blockingFor(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return new BRPopLPushCommand(getKey(), destination, timeout); } @@ -1563,8 +1563,8 @@ public interface ReactiveListCommands { */ default Mono bRPopLPush(ByteBuffer source, ByteBuffer destination, Duration timeout) { - Assert.notNull(source, "Source must not be null!"); - Assert.notNull(destination, "Destination must not be null!"); + Assert.notNull(source, "Source must not be null"); + Assert.notNull(destination, "Destination must not be null"); return bRPopLPush(Mono.just(BRPopLPushCommand.from(source).to(destination).blockingFor(timeout))).next() .map(ByteBufferResponse::getOutput); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveNumberCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveNumberCommands.java index 002a30857..105de22a0 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveNumberCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveNumberCommands.java @@ -44,7 +44,7 @@ public interface ReactiveNumberCommands { */ default Mono incr(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return incr(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -82,7 +82,7 @@ public interface ReactiveNumberCommands { */ public static IncrByCommand incr(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new IncrByCommand<>(key, null); } @@ -96,7 +96,7 @@ public interface ReactiveNumberCommands { */ public IncrByCommand by(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new IncrByCommand<>(getKey(), value); } @@ -121,8 +121,8 @@ public interface ReactiveNumberCommands { */ default Mono incrBy(ByteBuffer key, T value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return incrBy(Mono.just(IncrByCommand. incr(key).by(value))).next().map(NumericResponse::getOutput); } @@ -161,7 +161,7 @@ public interface ReactiveNumberCommands { */ public static DecrByCommand decr(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new DecrByCommand<>(key, null); } @@ -175,7 +175,7 @@ public interface ReactiveNumberCommands { */ public DecrByCommand by(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new DecrByCommand<>(getKey(), value); } @@ -198,7 +198,7 @@ public interface ReactiveNumberCommands { */ default Mono decr(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return decr(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -222,8 +222,8 @@ public interface ReactiveNumberCommands { */ default Mono decrBy(ByteBuffer key, T value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return decrBy(Mono.just(DecrByCommand. decr(key).by(value))).next().map(NumericResponse::getOutput); } @@ -263,7 +263,7 @@ public interface ReactiveNumberCommands { */ public static HIncrByCommand incr(ByteBuffer field) { - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(field, "Field must not be null"); return new HIncrByCommand<>(null, field, null); } @@ -277,7 +277,7 @@ public interface ReactiveNumberCommands { */ public HIncrByCommand by(T value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new HIncrByCommand<>(getKey(), field, value); } @@ -290,7 +290,7 @@ public interface ReactiveNumberCommands { */ public HIncrByCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new HIncrByCommand<>(key, field, value); } @@ -322,9 +322,9 @@ public interface ReactiveNumberCommands { */ default Mono hIncrBy(ByteBuffer key, ByteBuffer field, T value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return hIncrBy(Mono.just(HIncrByCommand. incr(field).by(value).forKey(key))).next() .map(NumericResponse::getOutput); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java index bcd1189d9..f333db1f1 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java @@ -226,7 +226,7 @@ public interface ReactiveRedisConnection extends Closeable { super(key); - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(options, "ScanOptions must not be null"); this.options = options; } @@ -297,7 +297,7 @@ public interface ReactiveRedisConnection extends Closeable { */ public RangeCommand within(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new RangeCommand(getKey(), range); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveScriptingCommands.java index 883a6bce5..ddc13c84f 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveScriptingCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveScriptingCommands.java @@ -65,7 +65,7 @@ public interface ReactiveScriptingCommands { */ default Mono scriptExists(String scriptSha) { - Assert.notNull(scriptSha, "ScriptSha must not be null!"); + Assert.notNull(scriptSha, "ScriptSha must not be null"); return scriptExists(Collections.singletonList(scriptSha)).singleOrEmpty(); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveSetCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveSetCommands.java index 856c9fc20..159d9e6a5 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveSetCommands.java @@ -72,7 +72,7 @@ public interface ReactiveSetCommands { */ public static SAddCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return values(Collections.singletonList(value)); } @@ -85,7 +85,7 @@ public interface ReactiveSetCommands { */ public static SAddCommand values(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new SAddCommand(null, new ArrayList<>(values)); } @@ -98,7 +98,7 @@ public interface ReactiveSetCommands { */ public SAddCommand to(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SAddCommand(key, values); } @@ -121,7 +121,7 @@ public interface ReactiveSetCommands { */ default Mono sAdd(ByteBuffer key, ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return sAdd(key, Collections.singletonList(value)); } @@ -136,8 +136,8 @@ public interface ReactiveSetCommands { */ default Mono sAdd(ByteBuffer key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return sAdd(Mono.just(SAddCommand.values(values).to(key))).next().map(NumericResponse::getOutput); } @@ -176,7 +176,7 @@ public interface ReactiveSetCommands { */ public static SRemCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return values(Collections.singletonList(value)); } @@ -189,7 +189,7 @@ public interface ReactiveSetCommands { */ public static SRemCommand values(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new SRemCommand(null, new ArrayList<>(values)); } @@ -202,7 +202,7 @@ public interface ReactiveSetCommands { */ public SRemCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SRemCommand(key, values); } @@ -225,7 +225,7 @@ public interface ReactiveSetCommands { */ default Mono sRem(ByteBuffer key, ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return sRem(key, Collections.singletonList(value)); } @@ -240,8 +240,8 @@ public interface ReactiveSetCommands { */ default Mono sRem(ByteBuffer key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return sRem(Mono.just(SRemCommand.values(values).from(key))).next().map(NumericResponse::getOutput); } @@ -297,7 +297,7 @@ public interface ReactiveSetCommands { */ public SPopCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SPopCommand(key, count); } @@ -316,7 +316,7 @@ public interface ReactiveSetCommands { */ default Mono sPop(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return sPop(Mono.just(SPopCommand.one().from(key))).next().map(ByteBufferResponse::getOutput); } @@ -331,7 +331,7 @@ public interface ReactiveSetCommands { */ default Flux sPop(ByteBuffer key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return sPop(SPopCommand.members(count).from(key)); } @@ -380,7 +380,7 @@ public interface ReactiveSetCommands { */ public static SMoveCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new SMoveCommand(null, null, value); } @@ -393,7 +393,7 @@ public interface ReactiveSetCommands { */ public SMoveCommand from(ByteBuffer source) { - Assert.notNull(source, "Source key must not be null!"); + Assert.notNull(source, "Source key must not be null"); return new SMoveCommand(source, destination, value); } @@ -407,7 +407,7 @@ public interface ReactiveSetCommands { */ public SMoveCommand to(ByteBuffer destination) { - Assert.notNull(destination, "Destination key must not be null!"); + Assert.notNull(destination, "Destination key must not be null"); return new SMoveCommand(getKey(), destination, value); } @@ -439,9 +439,9 @@ public interface ReactiveSetCommands { */ default Mono sMove(ByteBuffer sourceKey, ByteBuffer destinationKey, ByteBuffer value) { - Assert.notNull(sourceKey, "SourceKey must not be null!"); - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(sourceKey, "SourceKey must not be null"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(value, "Value must not be null"); return sMove(Mono.just(SMoveCommand.value(value).from(sourceKey).to(destinationKey))).next() .map(BooleanResponse::getOutput); @@ -465,7 +465,7 @@ public interface ReactiveSetCommands { */ default Mono sCard(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return sCard(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -504,7 +504,7 @@ public interface ReactiveSetCommands { */ public static SIsMemberCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new SIsMemberCommand(null, value); } @@ -517,7 +517,7 @@ public interface ReactiveSetCommands { */ public SIsMemberCommand of(ByteBuffer set) { - Assert.notNull(set, "Set key must not be null!"); + Assert.notNull(set, "Set key must not be null"); return new SIsMemberCommand(set, value); } @@ -540,8 +540,8 @@ public interface ReactiveSetCommands { */ default Mono sIsMember(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return sIsMember(Mono.just(SIsMemberCommand.value(value).of(key))).next().map(BooleanResponse::getOutput); } @@ -581,8 +581,8 @@ public interface ReactiveSetCommands { */ public static SMIsMemberCommand values(List values) { - Assert.notNull(values, "Values must not be null!"); - Assert.notEmpty(values, "Values must not be empty!"); + Assert.notNull(values, "Values must not be null"); + Assert.notEmpty(values, "Values must not be empty"); return new SMIsMemberCommand(null, values); } @@ -595,7 +595,7 @@ public interface ReactiveSetCommands { */ public SMIsMemberCommand of(ByteBuffer set) { - Assert.notNull(set, "Set key must not be null!"); + Assert.notNull(set, "Set key must not be null"); return new SMIsMemberCommand(set, values); } @@ -619,8 +619,8 @@ public interface ReactiveSetCommands { */ default Mono> sMIsMember(ByteBuffer key, List values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Value must not be null"); return sMIsMember(Mono.just(SMIsMemberCommand.values(values).of(key))).next().map(MultiValueResponse::getOutput); } @@ -657,7 +657,7 @@ public interface ReactiveSetCommands { */ public static SInterCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SInterCommand(new ArrayList<>(keys)); } @@ -685,7 +685,7 @@ public interface ReactiveSetCommands { */ default Flux sInter(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return sInter(Mono.just(SInterCommand.keys(keys))).flatMap(CommandResponse::getOutput); } @@ -724,7 +724,7 @@ public interface ReactiveSetCommands { */ public static SInterStoreCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SInterStoreCommand(null, new ArrayList<>(keys)); } @@ -738,7 +738,7 @@ public interface ReactiveSetCommands { */ public SInterStoreCommand storeAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SInterStoreCommand(key, keys); } @@ -761,8 +761,8 @@ public interface ReactiveSetCommands { */ default Mono sInterStore(ByteBuffer destinationKey, Collection keys) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(keys, "Keys must not be null"); return sInterStore(Mono.just(SInterStoreCommand.keys(keys).storeAt(destinationKey))).next() .map(NumericResponse::getOutput); @@ -799,7 +799,7 @@ public interface ReactiveSetCommands { */ public static SUnionCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SUnionCommand(new ArrayList<>(keys)); } @@ -827,7 +827,7 @@ public interface ReactiveSetCommands { */ default Flux sUnion(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return sUnion(Mono.just(SUnionCommand.keys(keys))).flatMap(CommandResponse::getOutput); } @@ -866,7 +866,7 @@ public interface ReactiveSetCommands { */ public static SUnionStoreCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SUnionStoreCommand(null, new ArrayList<>(keys)); } @@ -880,7 +880,7 @@ public interface ReactiveSetCommands { */ public SUnionStoreCommand storeAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SUnionStoreCommand(key, keys); } @@ -903,8 +903,8 @@ public interface ReactiveSetCommands { */ default Mono sUnionStore(ByteBuffer destinationKey, Collection keys) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(keys, "Keys must not be null"); return sUnionStore(Mono.just(SUnionStoreCommand.keys(keys).storeAt(destinationKey))).next() .map(NumericResponse::getOutput); @@ -941,7 +941,7 @@ public interface ReactiveSetCommands { */ public static SDiffCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SDiffCommand(new ArrayList<>(keys)); } @@ -969,7 +969,7 @@ public interface ReactiveSetCommands { */ default Flux sDiff(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return sDiff(Mono.just(SDiffCommand.keys(keys))).flatMap(CommandResponse::getOutput); } @@ -1008,7 +1008,7 @@ public interface ReactiveSetCommands { */ public static SDiffStoreCommand keys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new SDiffStoreCommand(null, new ArrayList<>(keys)); } @@ -1022,7 +1022,7 @@ public interface ReactiveSetCommands { */ public SDiffStoreCommand storeAt(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SDiffStoreCommand(key, keys); } @@ -1045,8 +1045,8 @@ public interface ReactiveSetCommands { */ default Mono sDiffStore(ByteBuffer destinationKey, Collection keys) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(keys, "Keys must not be null"); return sDiffStore(Mono.just(SDiffStoreCommand.keys(keys).storeAt(destinationKey))).next() .map(NumericResponse::getOutput); @@ -1070,7 +1070,7 @@ public interface ReactiveSetCommands { */ default Flux sMembers(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return sMembers(Mono.just(new KeyCommand(key))).flatMap(CommandResponse::getOutput); } @@ -1169,7 +1169,7 @@ public interface ReactiveSetCommands { */ public SRandMembersCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SRandMembersCommand(key, count); } @@ -1203,8 +1203,8 @@ public interface ReactiveSetCommands { */ default Flux sRandMember(ByteBuffer key, Long count) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(count, "Count must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(count, "Count must not be null"); return sRandMember(Mono.just(SRandMembersCommand.valueCount(count).from(key))).flatMap(CommandResponse::getOutput); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java index 1720d8e8a..a14e646be 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java @@ -87,7 +87,7 @@ public interface ReactiveStreamCommands { */ public static AcknowledgeCommand stream(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new AcknowledgeCommand(key, null, Collections.emptyList()); } @@ -100,7 +100,7 @@ public interface ReactiveStreamCommands { */ public AcknowledgeCommand forRecords(String... recordIds) { - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(recordIds, "recordIds must not be null"); return forRecords(Arrays.stream(recordIds).map(RecordId::of).toArray(RecordId[]::new)); } @@ -113,7 +113,7 @@ public interface ReactiveStreamCommands { */ public AcknowledgeCommand forRecords(RecordId... recordIds) { - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(recordIds, "recordIds must not be null"); List newrecordIds = new ArrayList<>(getRecordIds().size() + recordIds.length); newrecordIds.addAll(getRecordIds()); @@ -130,7 +130,7 @@ public interface ReactiveStreamCommands { */ public AcknowledgeCommand inGroup(String group) { - Assert.notNull(group, "Group must not be null!"); + Assert.notNull(group, "Group must not be null"); return new AcknowledgeCommand(getKey(), group, getRecordIds()); } @@ -156,8 +156,8 @@ public interface ReactiveStreamCommands { */ default Mono xAck(ByteBuffer key, String group, String... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "recordIds must not be null"); return xAck(Mono.just(AcknowledgeCommand.stream(key).inGroup(group).forRecords(recordIds))).next() .map(NumericResponse::getOutput); @@ -174,8 +174,8 @@ public interface ReactiveStreamCommands { */ default Mono xAck(ByteBuffer key, String group, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "recordIds must not be null"); return xAck(Mono.just(AcknowledgeCommand.stream(key).inGroup(group).forRecords(recordIds))).next() .map(NumericResponse::getOutput); @@ -222,7 +222,7 @@ public interface ReactiveStreamCommands { */ public static AddStreamRecord of(ByteBufferRecord record) { - Assert.notNull(record, "Record must not be null!"); + Assert.notNull(record, "Record must not be null"); return new AddStreamRecord(record, null, false, false, null); } @@ -235,7 +235,7 @@ public interface ReactiveStreamCommands { */ public static AddStreamRecord body(Map body) { - Assert.notNull(body, "Body must not be null!"); + Assert.notNull(body, "Body must not be null"); return new AddStreamRecord(StreamRecords.rawBuffer(body), null, false, false, null); } @@ -374,8 +374,8 @@ public interface ReactiveStreamCommands { */ default Mono xAdd(ByteBuffer key, Map body) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(body, "Body must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(body, "Body must not be null"); return xAdd(StreamRecords.newRecord().in(key).ofBuffer(body)); } @@ -389,7 +389,7 @@ public interface ReactiveStreamCommands { */ default Mono xAdd(ByteBufferRecord record) { - Assert.notNull(record, "Record must not be null!"); + Assert.notNull(record, "Record must not be null"); return xAdd(Mono.just(AddStreamRecord.of(record))).next().map(CommandResponse::getOutput); } @@ -533,7 +533,7 @@ public interface ReactiveStreamCommands { */ public static DeleteCommand stream(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new DeleteCommand(key, Collections.emptyList()); } @@ -546,7 +546,7 @@ public interface ReactiveStreamCommands { */ public DeleteCommand records(String... recordIds) { - Assert.notNull(recordIds, "RecordIds must not be null!"); + Assert.notNull(recordIds, "RecordIds must not be null"); return records(Arrays.stream(recordIds).map(RecordId::of).toArray(RecordId[]::new)); } @@ -559,7 +559,7 @@ public interface ReactiveStreamCommands { */ public DeleteCommand records(RecordId... recordIds) { - Assert.notNull(recordIds, "RecordIds must not be null!"); + Assert.notNull(recordIds, "RecordIds must not be null"); List newrecordIds = new ArrayList<>(getRecordIds().size() + recordIds.length); newrecordIds.addAll(getRecordIds()); @@ -584,8 +584,8 @@ public interface ReactiveStreamCommands { */ default Mono xDel(ByteBuffer key, String... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "RecordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "RecordIds must not be null"); return xDel(Mono.just(DeleteCommand.stream(key).records(recordIds))).next().map(CommandResponse::getOutput); } @@ -601,8 +601,8 @@ public interface ReactiveStreamCommands { */ default Mono xDel(ByteBuffer key, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "RecordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "RecordIds must not be null"); return xDel(Mono.just(DeleteCommand.stream(key).records(recordIds))).next().map(CommandResponse::getOutput); } @@ -626,7 +626,7 @@ public interface ReactiveStreamCommands { */ default Mono xLen(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return xLen(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -651,8 +651,8 @@ public interface ReactiveStreamCommands { */ default Mono xPending(ByteBuffer key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); return xPendingSummary(Mono.just(new PendingRecordsCommand(key, groupName, null, Range.unbounded(), null))).next() .map(CommandResponse::getOutput); @@ -902,7 +902,7 @@ public interface ReactiveStreamCommands { */ public RangeCommand within(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new RangeCommand(getKey(), range, getLimit()); } @@ -925,7 +925,7 @@ public interface ReactiveStreamCommands { */ public RangeCommand limit(Limit limit) { - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(limit, "Limit must not be null"); return new RangeCommand(getKey(), range, limit); } @@ -968,9 +968,9 @@ public interface ReactiveStreamCommands { */ default Flux xRange(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return xRange(Mono.just(RangeCommand.stream(key).within(range).limit(limit))).next() .flatMapMany(CommandResponse::getOutput); @@ -1018,7 +1018,7 @@ public interface ReactiveStreamCommands { */ public static ReadCommand from(StreamOffset streamOffset) { - Assert.notNull(streamOffset, "StreamOffset must not be null!"); + Assert.notNull(streamOffset, "StreamOffset must not be null"); return new ReadCommand(Collections.singletonList(streamOffset), StreamReadOptions.empty(), null); } @@ -1031,7 +1031,7 @@ public interface ReactiveStreamCommands { */ public static ReadCommand from(StreamOffset... streamOffsets) { - Assert.notNull(streamOffsets, "StreamOffsets must not be null!"); + Assert.notNull(streamOffsets, "StreamOffsets must not be null"); return new ReadCommand(Arrays.asList(streamOffsets), StreamReadOptions.empty(), null); } @@ -1044,7 +1044,7 @@ public interface ReactiveStreamCommands { */ public ReadCommand as(Consumer consumer) { - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); return new ReadCommand(getStreamOffsets(), getReadOptions(), consumer); } @@ -1058,7 +1058,7 @@ public interface ReactiveStreamCommands { */ public ReadCommand withOptions(StreamReadOptions options) { - Assert.notNull(options, "StreamReadOptions must not be null!"); + Assert.notNull(options, "StreamReadOptions must not be null"); return new ReadCommand(getStreamOffsets(), options, getConsumer()); } @@ -1099,8 +1099,8 @@ public interface ReactiveStreamCommands { */ default Flux xRead(StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); return read(Mono.just(ReadCommand.from(streams).withOptions(readOptions))).next() .flatMapMany(CommandResponse::getOutput); @@ -1402,9 +1402,9 @@ public interface ReactiveStreamCommands { default Flux xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); return read(Mono.just(ReadCommand.from(streams).withOptions(readOptions).as(consumer))).next() .flatMapMany(CommandResponse::getOutput); @@ -1433,9 +1433,9 @@ public interface ReactiveStreamCommands { */ default Flux xRevRange(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return xRevRange(Mono.just(RangeCommand.stream(key).within(range).limit(limit))).next() .flatMapMany(CommandResponse::getOutput); @@ -1474,7 +1474,7 @@ public interface ReactiveStreamCommands { */ public static TrimCommand stream(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new TrimCommand(key, null, false); } @@ -1548,7 +1548,7 @@ public interface ReactiveStreamCommands { */ default Mono xTrim(ByteBuffer key, long count, boolean approximateTrimming) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return xTrim(Mono.just(TrimCommand.stream(key).to(count).approximate(approximateTrimming))).next() .map(NumericResponse::getOutput); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveStringCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveStringCommands.java index f790f3df0..c6e349aa3 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveStringCommands.java @@ -81,7 +81,7 @@ public interface ReactiveStringCommands { */ public static SetCommand set(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SetCommand(key, null, null, null); } @@ -94,7 +94,7 @@ public interface ReactiveStringCommands { */ public SetCommand value(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new SetCommand(getKey(), value, expiration, option); } @@ -107,7 +107,7 @@ public interface ReactiveStringCommands { */ public SetCommand expiring(Expiration expiration) { - Assert.notNull(expiration, "Expiration must not be null!"); + Assert.notNull(expiration, "Expiration must not be null"); return new SetCommand(getKey(), value, expiration, option); } @@ -120,7 +120,7 @@ public interface ReactiveStringCommands { */ public SetCommand withSetOption(SetOption option) { - Assert.notNull(option, "SetOption must not be null!"); + Assert.notNull(option, "SetOption must not be null"); return new SetCommand(getKey(), value, expiration, option); } @@ -158,8 +158,8 @@ public interface ReactiveStringCommands { */ default Mono set(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return set(Mono.just(SetCommand.set(key).value(value))).next().map(BooleanResponse::getOutput); } @@ -177,8 +177,8 @@ public interface ReactiveStringCommands { */ default Mono set(ByteBuffer key, ByteBuffer value, Expiration expiration, SetOption option) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return set(Mono.just(SetCommand.set(key).value(value).withSetOption(option).expiring(expiration))).next() .map(BooleanResponse::getOutput); @@ -202,7 +202,7 @@ public interface ReactiveStringCommands { */ default Mono get(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return get(Mono.just(new KeyCommand(key))).next().filter(CommandResponse::isPresent) .map(CommandResponse::getOutput); @@ -228,7 +228,7 @@ public interface ReactiveStringCommands { */ default Mono getDel(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return getDel(Mono.just(new KeyCommand(key))).next().filter(CommandResponse::isPresent) .map(CommandResponse::getOutput); @@ -259,7 +259,7 @@ public interface ReactiveStringCommands { super(key); - Assert.notNull(expiration, "Expiration must not be null!"); + Assert.notNull(expiration, "Expiration must not be null"); this.expiration = expiration; } @@ -304,7 +304,7 @@ public interface ReactiveStringCommands { */ default Mono getEx(ByteBuffer key, Expiration expiration) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return getEx(Mono.just(GetExCommand.key(key).withExpiration(expiration))).next().filter(CommandResponse::isPresent) .map(CommandResponse::getOutput); @@ -331,8 +331,8 @@ public interface ReactiveStringCommands { */ default Mono getSet(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return getSet(Mono.just(SetCommand.set(key).value(value))).next().filter(CommandResponse::isPresent) .map(ByteBufferResponse::getOutput); @@ -357,7 +357,7 @@ public interface ReactiveStringCommands { */ default Mono> mGet(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return mGet(Mono.just(keys)).next().map(MultiValueResponse::getOutput); } @@ -381,8 +381,8 @@ public interface ReactiveStringCommands { */ default Mono setNX(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return setNX(Mono.just(SetCommand.set(key).value(value))).next().map(BooleanResponse::getOutput); } @@ -407,9 +407,9 @@ public interface ReactiveStringCommands { */ default Mono setEX(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) { - Assert.notNull(key, "Keys must not be null!"); - Assert.notNull(value, "Keys must not be null!"); - Assert.notNull(expireTimeout, "ExpireTimeout must not be null!"); + Assert.notNull(key, "Keys must not be null"); + Assert.notNull(value, "Keys must not be null"); + Assert.notNull(expireTimeout, "ExpireTimeout must not be null"); return setEX(Mono.just(SetCommand.set(key).value(value).expiring(expireTimeout))).next() .map(BooleanResponse::getOutput); @@ -435,9 +435,9 @@ public interface ReactiveStringCommands { */ default Mono pSetEX(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); - Assert.notNull(expireTimeout, "ExpireTimeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); + Assert.notNull(expireTimeout, "ExpireTimeout must not be null"); return pSetEX(Mono.just(SetCommand.set(key).value(value).expiring(expireTimeout))).next() .map(BooleanResponse::getOutput); @@ -480,7 +480,7 @@ public interface ReactiveStringCommands { */ public static MSetCommand mset(Map keyValuePairs) { - Assert.notNull(keyValuePairs, "Key-value pairs must not be null!"); + Assert.notNull(keyValuePairs, "Key-value pairs must not be null"); return new MSetCommand(keyValuePairs); } @@ -502,7 +502,7 @@ public interface ReactiveStringCommands { */ default Mono mSet(Map keyValuePairs) { - Assert.notNull(keyValuePairs, "Key-value pairs must not be null!"); + Assert.notNull(keyValuePairs, "Key-value pairs must not be null"); return mSet(Mono.just(MSetCommand.mset(keyValuePairs))).next().map(BooleanResponse::getOutput); } @@ -526,7 +526,7 @@ public interface ReactiveStringCommands { */ default Mono mSetNX(Map keyValuePairs) { - Assert.notNull(keyValuePairs, "Key-value pairs must not be null!"); + Assert.notNull(keyValuePairs, "Key-value pairs must not be null"); return mSetNX(Mono.just(MSetCommand.mset(keyValuePairs))).next().map(BooleanResponse::getOutput); } @@ -565,7 +565,7 @@ public interface ReactiveStringCommands { */ public static AppendCommand key(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new AppendCommand(key, null); } @@ -579,7 +579,7 @@ public interface ReactiveStringCommands { */ public AppendCommand append(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new AppendCommand(getKey(), value); } @@ -603,8 +603,8 @@ public interface ReactiveStringCommands { */ default Mono append(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return append(Mono.just(AppendCommand.key(key).append(value))).next().map(NumericResponse::getOutput); } @@ -629,7 +629,7 @@ public interface ReactiveStringCommands { */ default Mono getRange(ByteBuffer key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return getRange(Mono.just(RangeCommand.key(key).fromIndex(start).toIndex(end))) // .next() // @@ -671,7 +671,7 @@ public interface ReactiveStringCommands { */ public static SetRangeCommand overwrite(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SetRangeCommand(key, null, null); } @@ -684,7 +684,7 @@ public interface ReactiveStringCommands { */ public SetRangeCommand withValue(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new SetRangeCommand(getKey(), value, offset); } @@ -727,8 +727,8 @@ public interface ReactiveStringCommands { */ default Mono setRange(ByteBuffer key, ByteBuffer value, long offset) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return setRange(Mono.just(SetRangeCommand.overwrite(key).withValue(value).atPosition(offset))).next() .map(NumericResponse::getOutput); @@ -769,7 +769,7 @@ public interface ReactiveStringCommands { */ public static GetBitCommand bit(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new GetBitCommand(key, null); } @@ -803,7 +803,7 @@ public interface ReactiveStringCommands { */ default Mono getBit(ByteBuffer key, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return getBit(Mono.just(GetBitCommand.bit(key).atOffset(offset))).next().map(BooleanResponse::getOutput); } @@ -844,7 +844,7 @@ public interface ReactiveStringCommands { */ public static SetBitCommand bit(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new SetBitCommand(key, null, false); } @@ -895,7 +895,7 @@ public interface ReactiveStringCommands { */ default Mono setBit(ByteBuffer key, long offset, boolean value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return setBit(Mono.just(SetBitCommand.bit(key).atOffset(offset).to(value))).next().map(BooleanResponse::getOutput); } @@ -934,7 +934,7 @@ public interface ReactiveStringCommands { */ public static BitCountCommand bitCount(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new BitCountCommand(key, Range.unbounded()); } @@ -947,7 +947,7 @@ public interface ReactiveStringCommands { */ public BitCountCommand within(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new BitCountCommand(getKey(), range); } @@ -969,7 +969,7 @@ public interface ReactiveStringCommands { */ default Mono bitCount(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return bitCount(Mono.just(BitCountCommand.bitCount(key))).next().map(NumericResponse::getOutput); } @@ -986,7 +986,7 @@ public interface ReactiveStringCommands { */ default Mono bitCount(ByteBuffer key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return bitCount(Mono.just(BitCountCommand.bitCount(key).within(Range.open(start, end)))) // .next() // @@ -1029,7 +1029,7 @@ public interface ReactiveStringCommands { */ public static BitFieldCommand bitField(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new BitFieldCommand(key, null); } @@ -1043,7 +1043,7 @@ public interface ReactiveStringCommands { */ public BitFieldCommand commands(BitFieldSubCommands commands) { - Assert.notNull(commands, "BitFieldCommands must not be null!"); + Assert.notNull(commands, "BitFieldCommands must not be null"); return new BitFieldCommand(getKey(), commands); } @@ -1065,8 +1065,8 @@ public interface ReactiveStringCommands { */ default Mono> bitField(ByteBuffer key, BitFieldSubCommands subCommands) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(subCommands, "BitFieldSubCommands must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(subCommands, "BitFieldSubCommands must not be null"); return bitField(Mono.just(BitFieldCommand.bitField(key).commands(subCommands))).map(CommandResponse::getOutput) .next(); @@ -1110,7 +1110,7 @@ public interface ReactiveStringCommands { */ public static BitOpCommand perform(BitOperation bitOp) { - Assert.notNull(bitOp, "BitOperation must not be null!"); + Assert.notNull(bitOp, "BitOperation must not be null"); return new BitOpCommand(Collections.emptyList(), bitOp, null); } @@ -1124,7 +1124,7 @@ public interface ReactiveStringCommands { */ public BitOpCommand onKeys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new BitOpCommand(new ArrayList<>(keys), bitOp, destinationKey); } @@ -1138,7 +1138,7 @@ public interface ReactiveStringCommands { */ public BitOpCommand andSaveAs(ByteBuffer destinationKey) { - Assert.notNull(destinationKey, "Destination key must not be null!"); + Assert.notNull(destinationKey, "Destination key must not be null"); return new BitOpCommand(keys, bitOp, destinationKey); } @@ -1177,9 +1177,9 @@ public interface ReactiveStringCommands { */ default Mono bitOp(Collection keys, BitOperation bitOp, ByteBuffer destination) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(bitOp, "BitOperation must not be null!"); - Assert.notNull(destination, "Destination must not be null!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(bitOp, "BitOperation must not be null"); + Assert.notNull(destination, "Destination must not be null"); return bitOp(Mono.just(BitOpCommand.perform(bitOp).onKeys(keys).andSaveAs(destination))) // .next() // @@ -1278,7 +1278,7 @@ public interface ReactiveStringCommands { */ default Mono strLen(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return strLen(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java b/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java index 6a87e1240..eb91665a8 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java @@ -168,8 +168,8 @@ public interface ReactiveSubscription { */ public ChannelMessage(C channel, M message) { - Assert.notNull(channel, "Channel must not be null!"); - Assert.notNull(message, "Message must not be null!"); + Assert.notNull(channel, "Channel must not be null"); + Assert.notNull(message, "Message must not be null"); this.channel = channel; this.message = message; @@ -238,7 +238,7 @@ public interface ReactiveSubscription { super(channel, message); - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); this.pattern = pattern; } diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java index bc0607d70..8b2f00445 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java @@ -88,7 +88,7 @@ public interface ReactiveZSetCommands { */ public static ZAddCommand tuple(Tuple tuple) { - Assert.notNull(tuple, "Tuple must not be null!"); + Assert.notNull(tuple, "Tuple must not be null"); return tuples(Collections.singletonList(tuple)); } @@ -101,7 +101,7 @@ public interface ReactiveZSetCommands { */ public static ZAddCommand tuples(Collection tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); return new ZAddCommand(null, new ArrayList<>(tuples), false, false, false, false, false); } @@ -114,7 +114,7 @@ public interface ReactiveZSetCommands { */ public ZAddCommand to(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZAddCommand(key, tuples, upsert, returnTotalChanged, incr, gt, lt); } @@ -235,9 +235,9 @@ public interface ReactiveZSetCommands { */ default Mono zAdd(ByteBuffer key, Double score, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(score, "Score must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(score, "Score must not be null"); + Assert.notNull(value, "Value must not be null"); return zAdd(Mono.just(ZAddCommand.tuple(new DefaultTuple(ByteUtils.getBytes(value), score)).to(key))).next() .map(resp -> resp.getOutput().longValue()); @@ -253,8 +253,8 @@ public interface ReactiveZSetCommands { */ default Mono zAdd(ByteBuffer key, Collection tuples) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(tuples, "Tuples must not be null"); return zAdd(Mono.just(ZAddCommand.tuples(tuples).to(key))).next().map(resp -> resp.getOutput().longValue()); } @@ -294,7 +294,7 @@ public interface ReactiveZSetCommands { */ public static ZRemCommand values(ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return new ZRemCommand(null, Collections.singletonList(value)); } @@ -307,7 +307,7 @@ public interface ReactiveZSetCommands { */ public static ZRemCommand values(Collection values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return new ZRemCommand(null, new ArrayList<>(values)); } @@ -320,7 +320,7 @@ public interface ReactiveZSetCommands { */ public ZRemCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRemCommand(key, values); } @@ -343,7 +343,7 @@ public interface ReactiveZSetCommands { */ default Mono zRem(ByteBuffer key, ByteBuffer value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return zRem(key, Collections.singletonList(value)); } @@ -358,8 +358,8 @@ public interface ReactiveZSetCommands { */ default Mono zRem(ByteBuffer key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return zRem(Mono.just(ZRemCommand.values(values).from(key))).next().map(NumericResponse::getOutput); } @@ -400,7 +400,7 @@ public interface ReactiveZSetCommands { */ public static ZIncrByCommand scoreOf(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new ZIncrByCommand(null, member, null); } @@ -414,7 +414,7 @@ public interface ReactiveZSetCommands { */ public ZIncrByCommand by(Number increment) { - Assert.notNull(increment, "Increment must not be null!"); + Assert.notNull(increment, "Increment must not be null"); return new ZIncrByCommand(getKey(), value, increment); } @@ -427,7 +427,7 @@ public interface ReactiveZSetCommands { */ public ZIncrByCommand storedWithin(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZIncrByCommand(key, value, increment); } @@ -459,9 +459,9 @@ public interface ReactiveZSetCommands { */ default Mono zIncrBy(ByteBuffer key, Number increment, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(increment, "Increment must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(increment, "Increment must not be null"); + Assert.notNull(value, "Value must not be null"); return zIncrBy(Mono.just(ZIncrByCommand.scoreOf(value).by(increment).storedWithin(key))).next() .map(NumericResponse::getOutput); @@ -521,7 +521,7 @@ public interface ReactiveZSetCommands { */ public ZRandMemberCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRandMemberCommand(key, count); } @@ -641,7 +641,7 @@ public interface ReactiveZSetCommands { */ public static ZRankCommand indexOf(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new ZRankCommand(null, member, Direction.ASC); } @@ -655,7 +655,7 @@ public interface ReactiveZSetCommands { */ public static ZRankCommand reverseIndexOf(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new ZRankCommand(null, member, Direction.DESC); } @@ -668,7 +668,7 @@ public interface ReactiveZSetCommands { */ public ZRankCommand storedWithin(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRankCommand(key, value, direction); } @@ -698,8 +698,8 @@ public interface ReactiveZSetCommands { */ default Mono zRank(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return zRank(Mono.just(ZRankCommand.indexOf(value).storedWithin(key))).next().map(NumericResponse::getOutput); } @@ -714,8 +714,8 @@ public interface ReactiveZSetCommands { */ default Mono zRevRank(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return zRank(Mono.just(ZRankCommand.reverseIndexOf(value).storedWithin(key))).next() .map(NumericResponse::getOutput); @@ -763,7 +763,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeCommand valuesWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeCommand(null, range, Direction.ASC, false); } @@ -777,7 +777,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeCommand reverseValuesWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeCommand(null, range, Direction.DESC, false); } @@ -800,7 +800,7 @@ public interface ReactiveZSetCommands { */ public ZRangeCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRangeCommand(key, range, direction, withScores); } @@ -837,8 +837,8 @@ public interface ReactiveZSetCommands { */ default Flux zRange(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRange(Mono.just(ZRangeCommand.valuesWithin(range).from(key))) // .flatMap(CommandResponse::getOutput).map(tuple -> ByteBuffer.wrap(tuple.getValue())); @@ -854,7 +854,7 @@ public interface ReactiveZSetCommands { */ default Flux zRangeWithScores(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return zRange(Mono.just(ZRangeCommand.valuesWithin(range).withScores().from(key))) .flatMap(CommandResponse::getOutput); @@ -870,7 +870,7 @@ public interface ReactiveZSetCommands { */ default Flux zRevRange(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return zRange(Mono.just(ZRangeCommand.reverseValuesWithin(range).from(key))).flatMap(CommandResponse::getOutput) .map(tuple -> ByteBuffer.wrap(tuple.getValue())); @@ -886,7 +886,7 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeWithScores(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return zRange(Mono.just(ZRangeCommand.reverseValuesWithin(range).withScores().from(key))) .flatMap(CommandResponse::getOutput); @@ -936,7 +936,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeByScoreCommand scoresWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeByScoreCommand(null, range, Direction.ASC, false, null); } @@ -950,7 +950,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeByScoreCommand reverseScoresWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeByScoreCommand(null, range, Direction.DESC, false, null); } @@ -973,7 +973,7 @@ public interface ReactiveZSetCommands { */ public ZRangeByScoreCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRangeByScoreCommand(key, range, direction, withScores, limit); } @@ -986,7 +986,7 @@ public interface ReactiveZSetCommands { */ public ZRangeByScoreCommand limitTo(Limit limit) { - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(limit, "Limit must not be null"); return new ZRangeByScoreCommand(getKey(), range, direction, withScores, limit); } @@ -1029,8 +1029,8 @@ public interface ReactiveZSetCommands { */ default Flux zRangeByScore(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).from(key))) // .flatMap(CommandResponse::getOutput) // @@ -1048,9 +1048,9 @@ public interface ReactiveZSetCommands { */ default Flux zRangeByScore(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).from(key).limitTo(limit))) // .flatMap(CommandResponse::getOutput) // @@ -1067,8 +1067,8 @@ public interface ReactiveZSetCommands { */ default Flux zRangeByScoreWithScores(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).withScores().from(key))) .flatMap(CommandResponse::getOutput); @@ -1085,9 +1085,9 @@ public interface ReactiveZSetCommands { */ default Flux zRangeByScoreWithScores(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).withScores().from(key).limitTo(limit))) .flatMap(CommandResponse::getOutput); @@ -1103,7 +1103,7 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeByScore(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).from(key))) // .flatMap(CommandResponse::getOutput) // @@ -1121,9 +1121,9 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeByScore(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).from(key).limitTo(limit))) // .flatMap(CommandResponse::getOutput) // @@ -1140,8 +1140,8 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeByScoreWithScores(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRangeByScore(Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).withScores().from(key))) .flatMap(CommandResponse::getOutput); @@ -1158,9 +1158,9 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeByScoreWithScores(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return zRangeByScore( Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).withScores().from(key).limitTo(limit))) @@ -1243,7 +1243,7 @@ public interface ReactiveZSetCommands { */ public static ZCountCommand scoresWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZCountCommand(null, range); } @@ -1256,7 +1256,7 @@ public interface ReactiveZSetCommands { */ public ZCountCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZCountCommand(key, range); } @@ -1281,8 +1281,8 @@ public interface ReactiveZSetCommands { */ default Mono zCount(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zCount(Mono.just(ZCountCommand.scoresWithin(range).forKey(key))).next().map(NumericResponse::getOutput); } @@ -1322,7 +1322,7 @@ public interface ReactiveZSetCommands { */ public static ZLexCountCommand stringsWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZLexCountCommand(null, range); } @@ -1335,7 +1335,7 @@ public interface ReactiveZSetCommands { */ public ZLexCountCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZLexCountCommand(key, range); } @@ -1428,7 +1428,7 @@ public interface ReactiveZSetCommands { */ public ZPopCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZPopCommand(direction, key, count); } @@ -1508,7 +1508,7 @@ public interface ReactiveZSetCommands { */ public BZPopCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new BZPopCommand(key, timeout, timeUnit, count, direction); } @@ -1531,7 +1531,7 @@ public interface ReactiveZSetCommands { */ public BZPopCommand blockingFor(Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); return blockingFor(timeout.toMillis(), TimeUnit.MILLISECONDS); } @@ -1545,7 +1545,7 @@ public interface ReactiveZSetCommands { */ public BZPopCommand blockingFor(long timeout, TimeUnit timeUnit) { - Assert.notNull(timeUnit, "TimeUnit must not be null!"); + Assert.notNull(timeUnit, "TimeUnit must not be null"); return new BZPopCommand(getKey(), timeout, timeUnit, count, direction); } @@ -1693,7 +1693,7 @@ public interface ReactiveZSetCommands { */ default Mono zCard(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return zCard(Mono.just(new KeyCommand(key))).next().map(NumericResponse::getOutput); } @@ -1731,7 +1731,7 @@ public interface ReactiveZSetCommands { */ public static ZScoreCommand scoreOf(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new ZScoreCommand(null, member); } @@ -1744,7 +1744,7 @@ public interface ReactiveZSetCommands { */ public ZScoreCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZScoreCommand(key, value); } @@ -1767,8 +1767,8 @@ public interface ReactiveZSetCommands { */ default Mono zScore(ByteBuffer key, ByteBuffer value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return zScore(Mono.just(ZScoreCommand.scoreOf(value).forKey(key))).next().map(NumericResponse::getOutput); } @@ -1809,7 +1809,7 @@ public interface ReactiveZSetCommands { */ public static ZMScoreCommand scoreOf(ByteBuffer member) { - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(member, "Member must not be null"); return new ZMScoreCommand(null, Collections.singletonList(member)); } @@ -1822,7 +1822,7 @@ public interface ReactiveZSetCommands { */ public static ZMScoreCommand scoreOf(Collection members) { - Assert.notNull(members, "Members must not be null!"); + Assert.notNull(members, "Members must not be null"); return new ZMScoreCommand(null, members); } @@ -1835,7 +1835,7 @@ public interface ReactiveZSetCommands { */ public ZMScoreCommand forKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZMScoreCommand(key, values); } @@ -1859,8 +1859,8 @@ public interface ReactiveZSetCommands { */ default Mono> zMScore(ByteBuffer key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); return zMScore(Mono.just(ZMScoreCommand.scoreOf(values).forKey(key))).next().map(MultiValueResponse::getOutput); } @@ -1899,7 +1899,7 @@ public interface ReactiveZSetCommands { */ public static ZRemRangeByRankCommand valuesWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRemRangeByRankCommand(null, range); } @@ -1912,7 +1912,7 @@ public interface ReactiveZSetCommands { */ public ZRemRangeByRankCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRemRangeByRankCommand(key, range); } @@ -1935,8 +1935,8 @@ public interface ReactiveZSetCommands { */ default Mono zRemRangeByRank(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRemRangeByRank(Mono.just(ZRemRangeByRankCommand.valuesWithin(range).from(key))).next() .map(NumericResponse::getOutput); @@ -1985,7 +1985,7 @@ public interface ReactiveZSetCommands { */ public ZRemRangeByScoreCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRemRangeByScoreCommand(key, range); } @@ -2008,8 +2008,8 @@ public interface ReactiveZSetCommands { */ default Mono zRemRangeByScore(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRemRangeByScore(Mono.just(ZRemRangeByScoreCommand.scoresWithin(range).from(key))).next() .map(NumericResponse::getOutput); @@ -2059,7 +2059,7 @@ public interface ReactiveZSetCommands { */ public ZRemRangeByLexCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRemRangeByLexCommand(key, range); } @@ -2083,8 +2083,8 @@ public interface ReactiveZSetCommands { */ default Mono zRemRangeByLex(ByteBuffer key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRemRangeByLex(Mono.just(ZRemRangeByLexCommand.lexWithin(range).from(key))).next() .map(NumericResponse::getOutput); @@ -2123,7 +2123,7 @@ public interface ReactiveZSetCommands { */ public static ZDiffCommand sets(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZDiffCommand(new ArrayList<>(keys)); } @@ -2212,7 +2212,7 @@ public interface ReactiveZSetCommands { */ public static ZDiffStoreCommand sourceKeys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZDiffStoreCommand(null, new ArrayList<>(keys)); } @@ -2226,7 +2226,7 @@ public interface ReactiveZSetCommands { */ public ZDiffStoreCommand storeAs(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZDiffStoreCommand(key, sourceKeys); } @@ -2250,8 +2250,8 @@ public interface ReactiveZSetCommands { */ default Mono zDiffStore(ByteBuffer destinationKey, List sets) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sets, "Sets must not be null"); return zDiffStore(Mono.just(ZDiffStoreCommand.sourceKeys(sets).storeAs(destinationKey))).next() .map(NumericResponse::getOutput); @@ -2297,7 +2297,7 @@ public interface ReactiveZSetCommands { */ public static ZAggregateCommand sets(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZAggregateCommand(new ArrayList<>(keys), Collections.emptyList(), null); } @@ -2395,7 +2395,7 @@ public interface ReactiveZSetCommands { */ public static ZAggregateStoreCommand sets(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZAggregateStoreCommand(null, new ArrayList<>(keys), Collections.emptyList(), null); } @@ -2442,7 +2442,7 @@ public interface ReactiveZSetCommands { */ public ZAggregateStoreCommand storeAs(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZAggregateStoreCommand(key, sourceKeys, weights, aggregateFunction); } @@ -2479,7 +2479,7 @@ public interface ReactiveZSetCommands { */ default Flux zInter(List sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zInter(Mono.just(ZAggregateCommand.sets(sets))).flatMap(CommandResponse::getOutput); } @@ -2545,7 +2545,7 @@ public interface ReactiveZSetCommands { default Flux zInterWithScores(List sets, List weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zInterWithScores( Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights))) @@ -2564,7 +2564,7 @@ public interface ReactiveZSetCommands { */ default Flux zInterWithScores(List sets, Weights weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zInterWithScores( Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights))) @@ -2603,7 +2603,7 @@ public interface ReactiveZSetCommands { */ public static ZInterStoreCommand sets(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZInterStoreCommand(null, new ArrayList<>(keys), Collections.emptyList(), null); } @@ -2651,7 +2651,7 @@ public interface ReactiveZSetCommands { */ public ZInterStoreCommand storeAs(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZInterStoreCommand(key, getSourceKeys(), getWeights(), getAggregateFunction().orElse(null)); } @@ -2713,8 +2713,8 @@ public interface ReactiveZSetCommands { default Mono zInterStore(ByteBuffer destinationKey, List sets, List weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sets, "Sets must not be null"); return zInterStore(Mono.just( ZInterStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) @@ -2736,8 +2736,8 @@ public interface ReactiveZSetCommands { default Mono zInterStore(ByteBuffer destinationKey, List sets, Weights weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sets, "Sets must not be null"); return zInterStore(Mono.just( ZInterStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) @@ -2764,7 +2764,7 @@ public interface ReactiveZSetCommands { */ default Flux zUnion(List sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zUnion(Mono.just(ZAggregateCommand.sets(sets))).flatMap(CommandResponse::getOutput); } @@ -2820,7 +2820,7 @@ public interface ReactiveZSetCommands { default Flux zUnionWithScores(List sets, List weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zUnionWithScores( Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights))) @@ -2839,7 +2839,7 @@ public interface ReactiveZSetCommands { */ default Flux zUnionWithScores(List sets, Weights weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return zUnionWithScores( Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights))) @@ -2889,7 +2889,7 @@ public interface ReactiveZSetCommands { */ public static ZUnionStoreCommand sets(List keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return new ZUnionStoreCommand(null, new ArrayList<>(keys), Collections.emptyList(), null); } @@ -2936,7 +2936,7 @@ public interface ReactiveZSetCommands { */ public ZUnionStoreCommand storeAs(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZUnionStoreCommand(key, getSourceKeys(), getWeights(), getAggregateFunction().orElse(null)); } @@ -2998,8 +2998,8 @@ public interface ReactiveZSetCommands { default Mono zUnionStore(ByteBuffer destinationKey, List sets, List weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sets, "Sets must not be null"); return zUnionStore(Mono.just(ZAggregateStoreCommand.sets(sets).aggregateUsing(aggregateFunction) .applyWeights(weights).storeAs(destinationKey))).next().map(NumericResponse::getOutput); @@ -3020,8 +3020,8 @@ public interface ReactiveZSetCommands { default Mono zUnionStore(ByteBuffer destinationKey, List sets, Weights weights, @Nullable Aggregate aggregateFunction) { - Assert.notNull(destinationKey, "DestinationKey must not be null!"); - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(destinationKey, "DestinationKey must not be null"); + Assert.notNull(sets, "Sets must not be null"); return zUnionStore(Mono.just( ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey))) @@ -3068,7 +3068,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeByLexCommand stringsWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeByLexCommand(null, range, Direction.ASC, Limit.unlimited()); } @@ -3082,7 +3082,7 @@ public interface ReactiveZSetCommands { */ public static ZRangeByLexCommand reverseStringsWithin(Range range) { - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(range, "Range must not be null"); return new ZRangeByLexCommand(null, range, Direction.DESC, Limit.unlimited()); } @@ -3095,7 +3095,7 @@ public interface ReactiveZSetCommands { */ public ZRangeByLexCommand from(ByteBuffer key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ZRangeByLexCommand(key, range, direction, limit); } @@ -3108,7 +3108,7 @@ public interface ReactiveZSetCommands { */ public ZRangeByLexCommand limitTo(Limit limit) { - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(limit, "Limit must not be null"); return new ZRangeByLexCommand(getKey(), range, direction, limit); } @@ -3158,8 +3158,8 @@ public interface ReactiveZSetCommands { */ default Flux zRangeByLex(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return zRangeByLex(Mono.just(ZRangeByLexCommand.stringsWithin(range).from(key).limitTo(limit))) .flatMap(CommandResponse::getOutput); @@ -3189,9 +3189,9 @@ public interface ReactiveZSetCommands { */ default Flux zRevRangeByLex(ByteBuffer key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return zRangeByLex(Mono.just(ZRangeByLexCommand.reverseStringsWithin(range).from(key).limitTo(limit))) .flatMap(CommandResponse::getOutput); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java index 3af449f30..363e877d2 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java @@ -89,7 +89,7 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon */ public RedisClusterConfiguration(PropertySource propertySource) { - Assert.notNull(propertySource, "PropertySource must not be null!"); + Assert.notNull(propertySource, "PropertySource must not be null"); this.clusterNodes = new LinkedHashSet<>(); @@ -110,7 +110,7 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon */ public void setClusterNodes(Iterable nodes) { - Assert.notNull(nodes, "Cannot set cluster nodes to 'null'."); + Assert.notNull(nodes, "Cannot set cluster nodes to 'null'"); this.clusterNodes.clear(); @@ -131,7 +131,7 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon */ public void addClusterNode(RedisNode node) { - Assert.notNull(node, "ClusterNode must not be 'null'."); + Assert.notNull(node, "ClusterNode must not be 'null'"); this.clusterNodes.add(node); } @@ -193,7 +193,7 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon @Override public void setPassword(RedisPassword password) { - Assert.notNull(password, "RedisPassword must not be null!"); + Assert.notNull(password, "RedisPassword must not be null"); this.password = password; } @@ -244,8 +244,8 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon */ private static Map asMap(Collection clusterHostAndPorts, int redirects) { - Assert.notNull(clusterHostAndPorts, "ClusterHostAndPorts must not be null!"); - Assert.noNullElements(clusterHostAndPorts, "ClusterHostAndPorts must not contain null elements!"); + Assert.notNull(clusterHostAndPorts, "ClusterHostAndPorts must not be null"); + Assert.noNullElements(clusterHostAndPorts, "ClusterHostAndPorts must not contain null elements"); Map map = new HashMap<>(); map.put(REDIS_CLUSTER_NODES_CONFIG_PROPERTY, StringUtils.collectionToCommaDelimitedString(clusterHostAndPorts)); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterConnection.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterConnection.java index a361f7ffa..273b13272 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisClusterConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterConnection.java @@ -93,9 +93,9 @@ public interface RedisClusterConnection @Nullable default T execute(String command, byte[] key, Collection args) { - Assert.notNull(command, "Command must not be null!"); - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(command, "Command must not be null"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(args, "Args must not be null"); byte[][] commandArgs = new byte[args.size() + 1][]; diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java index 48d707f2b..663db6dcc 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java @@ -61,7 +61,7 @@ public class RedisClusterNode extends RedisNode { public RedisClusterNode(String id) { this(SlotRange.empty()); - Assert.notNull(id, "Id must not be null!"); + Assert.notNull(id, "Id must not be null"); this.id = id; } @@ -76,7 +76,7 @@ public class RedisClusterNode extends RedisNode { super(host, port); - Assert.notNull(slotRange, "SlotRange must not be null!"); + Assert.notNull(slotRange, "SlotRange must not be null"); this.slotRange = slotRange; } @@ -89,7 +89,7 @@ public class RedisClusterNode extends RedisNode { super(); - Assert.notNull(slotRange, "SlotRange must not be null!"); + Assert.notNull(slotRange, "SlotRange must not be null"); this.slotRange = slotRange; } @@ -178,8 +178,8 @@ public class RedisClusterNode extends RedisNode { */ public SlotRange(Integer lowerBound, Integer upperBound) { - Assert.notNull(lowerBound, "LowerBound must not be null!"); - Assert.notNull(upperBound, "UpperBound must not be null!"); + Assert.notNull(lowerBound, "LowerBound must not be null"); + Assert.notNull(upperBound, "UpperBound must not be null"); this.range = new LinkedHashSet<>(); for (int i = lowerBound; i <= upperBound; i++) { diff --git a/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java index 2241500ca..f907cde09 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java @@ -130,7 +130,7 @@ public interface RedisConfiguration { */ static Integer getDatabaseOrElse(@Nullable RedisConfiguration configuration, Supplier other) { - Assert.notNull(other, "Other must not be null!"); + Assert.notNull(other, "Other must not be null"); return isDatabaseIndexAware(configuration) ? ((WithDatabaseIndex) configuration).getDatabase() : other.get(); } @@ -144,7 +144,7 @@ public interface RedisConfiguration { @Nullable static String getUsernameOrElse(@Nullable RedisConfiguration configuration, Supplier other) { - Assert.notNull(other, "Other must not be null!"); + Assert.notNull(other, "Other must not be null"); return isAuthenticationAware(configuration) ? ((WithAuthentication) configuration).getUsername() : other.get(); } @@ -157,7 +157,7 @@ public interface RedisConfiguration { */ static RedisPassword getPasswordOrElse(@Nullable RedisConfiguration configuration, Supplier other) { - Assert.notNull(other, "Other must not be null!"); + Assert.notNull(other, "Other must not be null"); return isAuthenticationAware(configuration) ? ((WithAuthentication) configuration).getPassword() : other.get(); } @@ -171,7 +171,7 @@ public interface RedisConfiguration { */ static int getPortOrElse(@Nullable RedisConfiguration configuration, IntSupplier other) { - Assert.notNull(other, "Other must not be null!"); + Assert.notNull(other, "Other must not be null"); return isHostAndPortAware(configuration) ? ((WithHostAndPort) configuration).getPort() : other.getAsInt(); } @@ -185,7 +185,7 @@ public interface RedisConfiguration { */ static String getHostOrElse(@Nullable RedisConfiguration configuration, Supplier other) { - Assert.notNull(other, "Other must not be null!"); + Assert.notNull(other, "Other must not be null"); return isHostAndPortAware(configuration) ? ((WithHostAndPort) configuration).getHostName() : other.get(); } @@ -352,7 +352,7 @@ public interface RedisConfiguration { */ default void setMaster(String name) { - Assert.notNull(name, "Name of sentinel master must not be null."); + Assert.notNull(name, "Name of sentinel master must not be null"); setMaster(new SentinelMasterId(name)); } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java index d569a16f2..43c85ea7d 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java @@ -67,8 +67,8 @@ public interface RedisGeoCommands { @Nullable default Long geoAdd(byte[] key, GeoLocation location) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(location, "Location must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(location, "Location must not be null"); return geoAdd(key, location.getPoint(), location.getName()); } @@ -418,7 +418,7 @@ public interface RedisGeoCommands { */ public GeoSearchCommandArgs limit(long count, boolean any) { - Assert.isTrue(count > 0, "Count has to positive value."); + Assert.isTrue(count > 0, "Count has to positive value"); limit = count; if (any) { flags.add(GeoCommandFlag.any()); @@ -550,7 +550,7 @@ public interface RedisGeoCommands { */ public GeoSearchStoreCommandArgs limit(long count, boolean any) { - Assert.isTrue(count > 0, "Count has to positive value."); + Assert.isTrue(count > 0, "Count has to positive value"); this.limit = count; if (any) { flags.add(GeoCommandFlag.any()); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java index be96e2d26..757453904 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java @@ -59,7 +59,7 @@ public interface RedisKeyCommands { @Nullable default Boolean exists(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); Long count = exists(new byte[][] { key }); return count != null ? count > 0 : null; } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisNode.java b/src/main/java/org/springframework/data/redis/connection/RedisNode.java index 59025523c..5dbf894f4 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisNode.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisNode.java @@ -43,7 +43,7 @@ public class RedisNode implements NamedNode { */ public RedisNode(String host, int port) { - Assert.notNull(host, "host must not be null!"); + Assert.notNull(host, "host must not be null"); this.host = host; this.port = port; @@ -240,7 +240,7 @@ public class RedisNode implements NamedNode { */ public RedisNodeBuilder listeningAt(String host, int port) { - Assert.notNull(host, "Hostname must not be null."); + Assert.notNull(host, "Hostname must not be null"); node.host = host; node.port = port; return this; diff --git a/src/main/java/org/springframework/data/redis/connection/RedisPassword.java b/src/main/java/org/springframework/data/redis/connection/RedisPassword.java index 0ec83035f..d9001c7d6 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisPassword.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisPassword.java @@ -117,7 +117,7 @@ public class RedisPassword { */ public Optional map(Function mapper) { - Assert.notNull(mapper, "Mapper function must not be null!"); + Assert.notNull(mapper, "Mapper function must not be null"); return toOptional().map(mapper); } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java index 3f9a96d01..6bc3d676d 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java @@ -94,7 +94,7 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC */ public RedisSentinelConfiguration(PropertySource propertySource) { - Assert.notNull(propertySource, "PropertySource must not be null!"); + Assert.notNull(propertySource, "PropertySource must not be null"); this.sentinels = new LinkedHashSet<>(); @@ -123,7 +123,7 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC */ public void setSentinels(Iterable sentinels) { - Assert.notNull(sentinels, "Cannot set sentinels to 'null'."); + Assert.notNull(sentinels, "Cannot set sentinels to 'null'"); this.sentinels.clear(); @@ -143,13 +143,13 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC */ public void addSentinel(RedisNode sentinel) { - Assert.notNull(sentinel, "Sentinel must not be 'null'."); + Assert.notNull(sentinel, "Sentinel must not be 'null'"); this.sentinels.add(sentinel); } public void setMaster(NamedNode master) { - Assert.notNull(master, "Sentinel master node must not be 'null'."); + Assert.notNull(master, "Sentinel master node must not be 'null'"); this.master = master; } @@ -236,7 +236,7 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC @Override public void setPassword(RedisPassword password) { - Assert.notNull(password, "RedisPassword must not be null!"); + Assert.notNull(password, "RedisPassword must not be null"); this.dataNodePassword = password; } @@ -255,7 +255,7 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC @Override public void setSentinelPassword(RedisPassword sentinelPassword) { - Assert.notNull(sentinelPassword, "SentinelPassword must not be null!"); + Assert.notNull(sentinelPassword, "SentinelPassword must not be null"); this.sentinelPassword = sentinelPassword; } @@ -310,7 +310,7 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC String[] args = split(hostAndPort, ":"); - Assert.notNull(args, "HostAndPort need to be seperated by ':'."); + Assert.notNull(args, "HostAndPort need to be separated by ':'"); Assert.isTrue(args.length == 2, "Host and Port String needs to specified as host:port"); return new RedisNode(args[0], Integer.valueOf(args[1]).intValue()); } @@ -322,9 +322,9 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC */ private static Map asMap(String master, Set sentinelHostAndPorts) { - Assert.hasText(master, "Master address must not be null or empty!"); - Assert.notNull(sentinelHostAndPorts, "SentinelHostAndPorts must not be null!"); - Assert.noNullElements(sentinelHostAndPorts, "ClusterHostAndPorts must not contain null elements!"); + Assert.hasText(master, "Master address must not be null or empty"); + Assert.notNull(sentinelHostAndPorts, "SentinelHostAndPorts must not be null"); + Assert.noNullElements(sentinelHostAndPorts, "ClusterHostAndPorts must not contain null elements"); Map map = new HashMap<>(); map.put(REDIS_SENTINEL_MASTER_CONFIG_PROPERTY, master); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServer.java b/src/main/java/org/springframework/data/redis/connection/RedisServer.java index e652a8b92..a5a852c3b 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisServer.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisServer.java @@ -197,7 +197,7 @@ public class RedisServer extends RedisNode { */ public String get(INFO info) { - Assert.notNull(info, "Cannot retrieve client information for 'null'."); + Assert.notNull(info, "Cannot retrieve client information for 'null'"); return get(info.key); } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSocketConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisSocketConfiguration.java index 29fcaea02..336ca01aa 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisSocketConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisSocketConfiguration.java @@ -49,7 +49,7 @@ public class RedisSocketConfiguration implements RedisConfiguration, DomainSocke */ public RedisSocketConfiguration(String socket) { - Assert.hasText(socket, "Socket path must not be null nor empty!"); + Assert.hasText(socket, "Socket path must not be null nor empty"); this.socket = socket; } @@ -62,7 +62,7 @@ public class RedisSocketConfiguration implements RedisConfiguration, DomainSocke @Override public void setSocket(String socket) { - Assert.hasText(socket, "Socket must not be null nor empty!"); + Assert.hasText(socket, "Socket must not be null nor empty"); this.socket = socket; } @@ -98,7 +98,7 @@ public class RedisSocketConfiguration implements RedisConfiguration, DomainSocke @Override public void setPassword(RedisPassword password) { - Assert.notNull(password, "RedisPassword must not be null!"); + Assert.notNull(password, "RedisPassword must not be null"); this.password = password; } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java index 9e2930cb4..82681015d 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java @@ -64,9 +64,9 @@ public class RedisStandaloneConfiguration */ public RedisStandaloneConfiguration(String hostName, int port) { - Assert.hasText(hostName, "Host name must not be null or empty!"); + Assert.hasText(hostName, "Host name must not be null or empty"); Assert.isTrue(port >= 1 && port <= 65535, - () -> String.format("Port %d must be a valid TCP port in the range between 1-65535!", port)); + () -> String.format("Port %d must be a valid TCP port in the range between 1-65535", port)); this.hostName = hostName; this.port = port; @@ -123,7 +123,7 @@ public class RedisStandaloneConfiguration @Override public void setPassword(RedisPassword password) { - Assert.notNull(password, "RedisPassword must not be null!"); + Assert.notNull(password, "RedisPassword must not be null"); this.password = password; } diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java index 840a1c98e..6e097ce3c 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java @@ -80,7 +80,7 @@ public class RedisStaticMasterReplicaConfiguration implements RedisConfiguration */ private void addNode(RedisStandaloneConfiguration node) { - Assert.notNull(node, "RedisStandaloneConfiguration must not be null!"); + Assert.notNull(node, "RedisStandaloneConfiguration must not be null"); node.setPassword(password); node.setDatabase(database); @@ -143,7 +143,7 @@ public class RedisStaticMasterReplicaConfiguration implements RedisConfiguration @Override public void setPassword(RedisPassword password) { - Assert.notNull(password, "RedisPassword must not be null!"); + Assert.notNull(password, "RedisPassword must not be null"); this.password = password; this.nodes.forEach(it -> it.setPassword(password)); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java index 1b587530a..0fe5f8b0a 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java @@ -479,7 +479,7 @@ public interface RedisStreamCommands { XClaimOptionsBuilder(Duration minIdleTime) { - Assert.notNull(minIdleTime, "Min idle time must not be null!"); + Assert.notNull(minIdleTime, "Min idle time must not be null"); this.minIdleTime = minIdleTime; } diff --git a/src/main/java/org/springframework/data/redis/connection/convert/Converters.java b/src/main/java/org/springframework/data/redis/connection/convert/Converters.java index 7a8bb6449..8b8513750 100644 --- a/src/main/java/org/springframework/data/redis/connection/convert/Converters.java +++ b/src/main/java/org/springframework/data/redis/connection/convert/Converters.java @@ -224,7 +224,7 @@ public abstract class Converters { */ public static long secondsToTimeUnit(long seconds, TimeUnit targetUnit) { - Assert.notNull(targetUnit, "TimeUnit must not be null!"); + Assert.notNull(targetUnit, "TimeUnit must not be null"); if (seconds > 0) { return targetUnit.convert(seconds, TimeUnit.SECONDS); @@ -254,7 +254,7 @@ public abstract class Converters { */ public static long millisecondsToTimeUnit(long milliseconds, TimeUnit targetUnit) { - Assert.notNull(targetUnit, "TimeUnit must not be null!"); + Assert.notNull(targetUnit, "TimeUnit must not be null"); if (milliseconds > 0) { return targetUnit.convert(milliseconds, TimeUnit.MILLISECONDS); @@ -307,8 +307,8 @@ public abstract class Converters { */ public static Properties toProperties(List input) { - Assert.notNull(input, "Input list must not be null!"); - Assert.isTrue(input.size() % 2 == 0, "Input list must contain an even number of entries!"); + Assert.notNull(input, "Input list must not be null"); + Assert.isTrue(input.size() % 2 == 0, "Input list must contain an even number of entries"); Properties properties = new Properties(); @@ -406,7 +406,7 @@ public abstract class Converters { } if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("parsing %s (%s) as %s.", sourcePath, path, targetType)); + LOGGER.debug(String.format("parsing %s (%s) as %s", sourcePath, path, targetType)); } if (targetType == Object.class) { @@ -556,7 +556,7 @@ public abstract class Converters { String[] args = source.split(" "); String[] hostAndPort = StringUtils.split(args[HOST_PORT_INDEX], ":"); - Assert.notNull(hostAndPort, "ClusterNode information does not define host and port!"); + Assert.notNull(hostAndPort, "ClusterNode information does not define host and port"); SlotRange range = parseSlotRange(args); Set flags = parseFlags(args); diff --git a/src/main/java/org/springframework/data/redis/connection/convert/SetConverter.java b/src/main/java/org/springframework/data/redis/connection/convert/SetConverter.java index adb064654..11cff5e4b 100644 --- a/src/main/java/org/springframework/data/redis/connection/convert/SetConverter.java +++ b/src/main/java/org/springframework/data/redis/connection/convert/SetConverter.java @@ -40,7 +40,7 @@ public class SetConverter implements Converter, Set> { */ public SetConverter(Converter itemConverter) { - Assert.notNull(itemConverter, "ItemConverter must not be null!"); + Assert.notNull(itemConverter, "ItemConverter must not be null"); this.itemConverter = itemConverter; } diff --git a/src/main/java/org/springframework/data/redis/connection/convert/TransactionResultConverter.java b/src/main/java/org/springframework/data/redis/connection/convert/TransactionResultConverter.java index 3e942834c..8b7c2a732 100644 --- a/src/main/java/org/springframework/data/redis/connection/convert/TransactionResultConverter.java +++ b/src/main/java/org/springframework/data/redis/connection/convert/TransactionResultConverter.java @@ -51,7 +51,7 @@ public class TransactionResultConverter implements Converter, Li if (execResults.size() != txResults.size()) { throw new IllegalArgumentException( - "Incorrect number of transaction results. Expected: " + txResults.size() + " Actual: " + execResults.size()); + "Incorrect number of transaction results; Expected: " + txResults.size() + " Actual: " + execResults.size()); } List convertedResults = new ArrayList<>(); @@ -63,7 +63,7 @@ public class TransactionResultConverter implements Converter, Li Exception source = (Exception) result; DataAccessException convertedException = exceptionConverter.convert(source); throw convertedException != null ? convertedException - : new RedisSystemException("Error reading future result.", source); + : new RedisSystemException("Error reading future result", source); } if (!(futureResult.isStatus())) { convertedResults.add(futureResult.conversionRequired() ? futureResult.convert(result) : result); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClientConfiguration.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClientConfiguration.java index 0908afedc..280539ead 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClientConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClientConfiguration.java @@ -291,7 +291,7 @@ public interface JedisClientConfiguration { @Override public JedisSslClientConfigurationBuilder sslSocketFactory(SSLSocketFactory sslSocketFactory) { - Assert.notNull(sslSocketFactory, "SSLSocketFactory must not be null!"); + Assert.notNull(sslSocketFactory, "SSLSocketFactory must not be null"); this.sslSocketFactory = sslSocketFactory; return this; @@ -300,7 +300,7 @@ public interface JedisClientConfiguration { @Override public JedisSslClientConfigurationBuilder sslParameters(SSLParameters sslParameters) { - Assert.notNull(sslParameters, "SSLParameters must not be null!"); + Assert.notNull(sslParameters, "SSLParameters must not be null"); this.sslParameters = sslParameters; return this; @@ -309,7 +309,7 @@ public interface JedisClientConfiguration { @Override public JedisSslClientConfigurationBuilder hostnameVerifier(HostnameVerifier hostnameVerifier) { - Assert.notNull(hostnameVerifier, "HostnameVerifier must not be null!"); + Assert.notNull(hostnameVerifier, "HostnameVerifier must not be null"); this.hostnameVerifier = hostnameVerifier; return this; @@ -325,7 +325,7 @@ public interface JedisClientConfiguration { @Override public JedisPoolingClientConfigurationBuilder poolConfig(GenericObjectPoolConfig poolConfig) { - Assert.notNull(poolConfig, "GenericObjectPoolConfig must not be null!"); + Assert.notNull(poolConfig, "GenericObjectPoolConfig must not be null"); this.poolConfig = poolConfig; return this; @@ -339,7 +339,7 @@ public interface JedisClientConfiguration { @Override public JedisClientConfigurationBuilder clientName(String clientName) { - Assert.hasText(clientName, "Client name must not be null or empty!"); + Assert.hasText(clientName, "Client name must not be null or empty"); this.clientName = clientName; return this; @@ -348,7 +348,7 @@ public interface JedisClientConfiguration { @Override public JedisClientConfigurationBuilder readTimeout(Duration readTimeout) { - Assert.notNull(readTimeout, "Duration must not be null!"); + Assert.notNull(readTimeout, "Duration must not be null"); this.readTimeout = readTimeout; return this; @@ -357,7 +357,7 @@ public interface JedisClientConfiguration { @Override public JedisClientConfigurationBuilder connectTimeout(Duration connectTimeout) { - Assert.notNull(connectTimeout, "Duration must not be null!"); + Assert.notNull(connectTimeout, "Duration must not be null"); this.connectTimeout = connectTimeout; return this; diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java index 6f02406d1..26b810cac 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java @@ -105,7 +105,7 @@ public class JedisClusterConnection implements RedisClusterConnection { */ public JedisClusterConnection(JedisCluster cluster) { - Assert.notNull(cluster, "JedisCluster must not be null."); + Assert.notNull(cluster, "JedisCluster must not be null"); this.cluster = cluster; @@ -149,9 +149,9 @@ public class JedisClusterConnection implements RedisClusterConnection { public JedisClusterConnection(JedisCluster cluster, ClusterCommandExecutor executor, ClusterTopologyProvider topologyProvider) { - Assert.notNull(cluster, "JedisCluster must not be null."); - Assert.notNull(executor, "ClusterCommandExecutor must not be null."); - Assert.notNull(topologyProvider, "ClusterTopologyProvider must not be null."); + Assert.notNull(cluster, "JedisCluster must not be null"); + Assert.notNull(executor, "ClusterCommandExecutor must not be null"); + Assert.notNull(topologyProvider, "ClusterTopologyProvider must not be null"); this.closed = false; this.cluster = cluster; @@ -164,8 +164,8 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public Object execute(String command, byte[]... args) { - Assert.notNull(command, "Command must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(command, "Command must not be null"); + Assert.notNull(args, "Args must not be null"); return clusterCommandExecutor.executeCommandOnArbitraryNode( (JedisClusterCommandCallback) client -> client.sendCommand(JedisClientUtils.getCommand(command), args)) @@ -176,9 +176,9 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public T execute(String command, byte[] key, Collection args) { - Assert.notNull(command, "Command must not be null!"); - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(command, "Command must not be null"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(args, "Args must not be null"); byte[][] commandArgs = getCommandArguments(key, args); @@ -227,9 +227,9 @@ public class JedisClusterConnection implements RedisClusterConnection { @Nullable public List execute(String command, Collection keys, Collection args) { - Assert.notNull(command, "Command must not be null!"); - Assert.notNull(keys, "Key must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(command, "Command must not be null"); + Assert.notNull(keys, "Key must not be null"); + Assert.notNull(args, "Args must not be null"); return clusterCommandExecutor.executeMultiKeyCommand((JedisMultiKeyClusterCommandCallback) (client, key) -> { return (T) client.sendCommand(JedisClientUtils.getCommand(command), getCommandArguments(key, args)); @@ -319,27 +319,27 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void multi() { - throw new InvalidDataAccessApiUsageException("MULTI is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("MULTI is currently not supported in cluster mode"); } @Override public List exec() { - throw new InvalidDataAccessApiUsageException("EXEC is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("EXEC is currently not supported in cluster mode"); } @Override public void discard() { - throw new InvalidDataAccessApiUsageException("DISCARD is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("DISCARD is currently not supported in cluster mode"); } @Override public void watch(byte[]... keys) { - throw new InvalidDataAccessApiUsageException("WATCH is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("WATCH is currently not supported in cluster mode"); } @Override public void unwatch() { - throw new InvalidDataAccessApiUsageException("UNWATCH is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("UNWATCH is currently not supported in cluster mode"); } @Override @@ -397,13 +397,13 @@ public class JedisClusterConnection implements RedisClusterConnection { public void select(int dbIndex) { if (dbIndex != 0) { - throw new InvalidDataAccessApiUsageException("Cannot SELECT non zero index in cluster mode."); + throw new InvalidDataAccessApiUsageException("Cannot SELECT non zero index in cluster mode"); } } @Override public byte[] echo(byte[] message) { - throw new InvalidDataAccessApiUsageException("Echo not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("Echo not supported in cluster mode"); } @Override @@ -428,8 +428,8 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void clusterSetSlot(RedisClusterNode node, int slot, AddSlots mode) { - Assert.notNull(node, "Node must not be null."); - Assert.notNull(mode, "AddSlots mode must not be null."); + Assert.notNull(node, "Node must not be null"); + Assert.notNull(mode, "AddSlots mode must not be null"); RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(node); String nodeId = nodeToUse.getId(); @@ -447,7 +447,7 @@ public class JedisClusterConnection implements RedisClusterConnection { return client.clusterSetSlotNode(slot, nodeId); } - throw new IllegalArgumentException(String.format("Unknown AddSlots mode '%s'.", mode)); + throw new IllegalArgumentException(String.format("Unknown AddSlots mode '%s'", mode)); }, node); } @@ -476,7 +476,7 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void clusterAddSlots(RedisClusterNode node, SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); clusterAddSlots(node, range.getSlotsArray()); } @@ -501,7 +501,7 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void clusterDeleteSlotsInRange(RedisClusterNode node, SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); clusterDeleteSlots(node, range.getSlotsArray()); } @@ -520,9 +520,9 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void clusterMeet(RedisClusterNode node) { - Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command!"); - Assert.hasText(node.getHost(), "Node to meet cluster must have a host!"); - Assert.isTrue(node.getPort() > 0, "Node to meet cluster must have a port greater 0!"); + Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command"); + Assert.hasText(node.getHost(), "Node to meet cluster must have a host"); + Assert.isTrue(node.getPort() > 0, "Node to meet cluster must have a port greater 0"); clusterCommandExecutor.executeCommandOnAllNodes( (JedisClusterCommandCallback) client -> client.clusterMeet(node.getHost(), node.getPort())); @@ -572,7 +572,7 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public Set clusterGetReplicas(RedisClusterNode master) { - Assert.notNull(master, "Master cannot be null!"); + Assert.notNull(master, "Master cannot be null"); RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(master); @@ -653,17 +653,17 @@ public class JedisClusterConnection implements RedisClusterConnection { @Override public void openPipeline() { - throw new InvalidDataAccessApiUsageException("Pipeline is not supported for JedisClusterConnection."); + throw new InvalidDataAccessApiUsageException("Pipeline is not supported for JedisClusterConnection"); } @Override public List closePipeline() throws RedisPipelineException { - throw new InvalidDataAccessApiUsageException("Pipeline is not supported for JedisClusterConnection."); + throw new InvalidDataAccessApiUsageException("Pipeline is not supported for JedisClusterConnection"); } @Override public RedisSentinelConnection getSentinelConnection() { - throw new InvalidDataAccessApiUsageException("Sentinel is not supported for JedisClusterConnection."); + throw new InvalidDataAccessApiUsageException("Sentinel is not supported for JedisClusterConnection"); } @Override @@ -728,7 +728,7 @@ public class JedisClusterConnection implements RedisClusterConnection { @SuppressWarnings("unchecked") public Jedis getResourceForSpecificNode(RedisClusterNode node) { - Assert.notNull(node, "Cannot get Pool for 'null' node!"); + Assert.notNull(node, "Cannot get Pool for 'null' node"); ConnectionPool pool = getResourcePoolForSpecificNode(node); if (pool != null) { @@ -760,7 +760,7 @@ public class JedisClusterConnection implements RedisClusterConnection { if (!member.hasValidHost()) { throw new DataAccessResourceFailureException(String - .format("Cannot obtain connection to node %ss as it is not associated with a hostname!", node.getId())); + .format("Cannot obtain connection to node %ss as it is not associated with a hostname", node.getId())); } if (member != null && connectionHandler != null) { @@ -809,9 +809,9 @@ public class JedisClusterConnection implements RedisClusterConnection { */ public JedisClusterTopologyProvider(JedisCluster cluster, Duration cacheTimeout) { - Assert.notNull(cluster, "JedisCluster must not be null!"); - Assert.notNull(cacheTimeout, "Cache timeout must not be null!"); - Assert.isTrue(!cacheTimeout.isNegative(), "Cache timeout must not be negative."); + Assert.notNull(cluster, "JedisCluster must not be null"); + Assert.notNull(cacheTimeout, "Cache timeout must not be null"); + Assert.isTrue(!cacheTimeout.isNegative(), "Cache timeout must not be negative"); this.cluster = cluster; this.cacheTimeMs = cacheTimeout.toMillis(); @@ -852,7 +852,7 @@ public class JedisClusterConnection implements RedisClusterConnection { } throw new ClusterStateFailureException( - "Could not retrieve cluster information. CLUSTER NODES returned with error." + sb.toString()); + "Could not retrieve cluster information; CLUSTER NODES returned with error" + sb.toString()); } /** diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterGeoCommands.java index 30911ea8b..054703299 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterGeoCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterGeoCommands.java @@ -46,16 +46,16 @@ class JedisClusterGeoCommands implements RedisGeoCommands { JedisClusterGeoCommands(JedisClusterConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @Override public Long geoAdd(byte[] key, Point point, byte[] member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(point, "Point must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(point, "Point must not be null"); + Assert.notNull(member, "Member must not be null"); try { return connection.getCluster().geoadd(key, point.getX(), point.getY(), member); @@ -67,8 +67,8 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Map memberCoordinateMap) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null"); Map redisGeoCoordinateMap = new HashMap<>(); for (byte[] mapKey : memberCoordinateMap.keySet()) { @@ -85,8 +85,8 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Iterable> locations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(locations, "Locations must not be null"); Map redisGeoCoordinateMap = new HashMap<>(); for (GeoLocation location : locations) { @@ -103,9 +103,9 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public Distance geoDist(byte[] key, byte[] member1, byte[] member2) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member1 must not be null!"); - Assert.notNull(member2, "Member2 must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member1 must not be null"); + Assert.notNull(member2, "Member2 must not be null"); try { return JedisConverters.distanceConverterForMetric(DistanceUnit.METERS) @@ -118,10 +118,10 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member1 must not be null!"); - Assert.notNull(member2, "Member2 must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member1 must not be null"); + Assert.notNull(member2, "Member2 must not be null"); + Assert.notNull(metric, "Metric must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(metric); try { @@ -135,9 +135,9 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public List geoHash(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); try { return JedisConverters.toStrings(connection.getCluster().geohash(key, members)); @@ -149,9 +149,9 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public List geoPos(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); try { return JedisConverters.geoCoordinateToPointConverter().convert(connection.getCluster().geopos(key, members)); @@ -163,8 +163,8 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); try { return JedisConverters.geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric()) @@ -178,9 +178,9 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); + Assert.notNull(args, "Args must not be null"); GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args); @@ -197,9 +197,9 @@ class JedisClusterGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric()); try { @@ -214,10 +214,10 @@ class JedisClusterGeoCommands implements RedisGeoCommands { public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); + Assert.notNull(args, "Args must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric()); redis.clients.jedis.params.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args); @@ -240,7 +240,7 @@ class JedisClusterGeoCommands implements RedisGeoCommands { public GeoResults> geoSearch(byte[] key, GeoReference reference, GeoShape predicate, GeoSearchCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); GeoSearchParam params = JedisConverters.toGeoSearchParams(reference, predicate, args); try { @@ -256,8 +256,8 @@ class JedisClusterGeoCommands implements RedisGeoCommands { public Long geoSearchStore(byte[] destKey, byte[] key, GeoReference reference, GeoShape predicate, GeoSearchStoreCommandArgs args) { - Assert.notNull(destKey, "Destination Key must not be null!"); - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(destKey, "Destination Key must not be null"); + Assert.notNull(key, "Key must not be null"); GeoSearchParam params = JedisConverters.toGeoSearchParams(reference, predicate, args); try { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHashCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHashCommands.java index d48b78109..d6d0f9de8 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHashCommands.java @@ -51,9 +51,9 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().hset(key, field, value)); @@ -65,9 +65,9 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Boolean hSetNX(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().hsetnx(key, field, value)); @@ -79,8 +79,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public byte[] hGet(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); try { return connection.getCluster().hget(key, field); @@ -92,8 +92,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public List hMGet(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); try { return connection.getCluster().hmget(key, fields); @@ -105,8 +105,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public void hMSet(byte[] key, Map hashes) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashes, "Hashes must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashes, "Hashes must not be null"); try { connection.getCluster().hmset(key, hashes); @@ -118,8 +118,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Long hIncrBy(byte[] key, byte[] field, long delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); try { return connection.getCluster().hincrBy(key, field, delta); @@ -131,8 +131,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Double hIncrBy(byte[] key, byte[] field, double delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); try { return connection.getCluster().hincrByFloat(key, field, delta); @@ -145,7 +145,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public byte[] hRandField(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().hrandfield(key); @@ -158,7 +158,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Entry hRandFieldWithValues(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { Map map = connection.getCluster().hrandfieldWithValues(key, 1); @@ -172,7 +172,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public List hRandField(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().hrandfield(key, count); @@ -196,8 +196,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Boolean hExists(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); try { return connection.getCluster().hexists(key, field); @@ -209,8 +209,8 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Long hDel(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); try { return connection.getCluster().hdel(key, fields); @@ -222,7 +222,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Long hLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().hlen(key); @@ -234,7 +234,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Set hKeys(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().hkeys(key); @@ -246,7 +246,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public List hVals(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new ArrayList<>(connection.getCluster().hvals(key)); @@ -258,7 +258,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Map hGetAll(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().hgetAll(key); @@ -270,7 +270,7 @@ class JedisClusterHashCommands implements RedisHashCommands { @Override public Cursor> hScan(byte[] key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ScanCursor>(options) { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHyperLogLogCommands.java index bce4dcb25..92a0a20d9 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHyperLogLogCommands.java @@ -38,8 +38,8 @@ class JedisClusterHyperLogLogCommands implements RedisHyperLogLogCommands { @Override public Long pfAdd(byte[] key, byte[]... values) { - Assert.notEmpty(values, "PFADD requires at least one non 'null' value."); - Assert.noNullElements(values, "Values for PFADD must not contain 'null'."); + Assert.notEmpty(values, "PFADD requires at least one non 'null' value"); + Assert.noNullElements(values, "Values for PFADD must not contain 'null'"); try { return connection.getCluster().pfadd(key, values); @@ -51,8 +51,8 @@ class JedisClusterHyperLogLogCommands implements RedisHyperLogLogCommands { @Override public Long pfCount(byte[]... keys) { - Assert.notEmpty(keys, "PFCOUNT requires at least one non 'null' key."); - Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'."); + Assert.notEmpty(keys, "PFCOUNT requires at least one non 'null' key"); + Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { @@ -63,7 +63,7 @@ class JedisClusterHyperLogLogCommands implements RedisHyperLogLogCommands { } } - throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfcount in cluster mode."); + throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfcount in cluster mode"); } @Override @@ -71,7 +71,7 @@ class JedisClusterHyperLogLogCommands implements RedisHyperLogLogCommands { Assert.notNull(destinationKey, "Destination key must not be null"); Assert.notNull(sourceKeys, "Source keys must not be null"); - Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'."); + Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'"); byte[][] allKeys = ByteUtils.mergeArrays(destinationKey, sourceKeys); @@ -84,7 +84,7 @@ class JedisClusterHyperLogLogCommands implements RedisHyperLogLogCommands { } } - throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfmerge in cluster mode."); + throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfmerge in cluster mode"); } private DataAccessException convertJedisAccessException(Exception ex) { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterKeyCommands.java index 578f0d540..ab83a7f31 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterKeyCommands.java @@ -69,8 +69,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean copy(byte[] sourceKey, byte[] targetKey, boolean replace) { - Assert.notNull(sourceKey, "source key must not be null!"); - Assert.notNull(targetKey, "target key must not be null!"); + Assert.notNull(sourceKey, "source key must not be null"); + Assert.notNull(targetKey, "target key must not be null"); return connection.getCluster().copy(sourceKey, targetKey, replace); } @@ -78,8 +78,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long del(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -99,7 +99,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long unlink(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection. execute("UNLINK", Arrays.asList(keys), Collections.emptyList()).stream() .mapToLong(val -> val).sum(); @@ -108,7 +108,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public DataType type(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toDataType(connection.getCluster().type(key)); @@ -121,7 +121,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long touch(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection. execute("TOUCH", Arrays.asList(keys), Collections.emptyList()).stream() .mapToLong(val -> val).sum(); @@ -130,7 +130,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Set keys(byte[] pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); Collection> keysPerNode = connection.getClusterCommandExecutor() .executeCommandOnAllNodes((JedisClusterCommandCallback>) client -> client.keys(pattern)) @@ -145,8 +145,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { public Set keys(RedisClusterNode node, byte[] pattern) { - Assert.notNull(node, "RedisClusterNode must not be null!"); - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); + Assert.notNull(pattern, "Pattern must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback>) client -> client.keys(pattern), node) @@ -168,8 +168,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { */ Cursor scan(RedisClusterNode node, ScanOptions options) { - Assert.notNull(node, "RedisClusterNode must not be null!"); - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); + Assert.notNull(options, "Options must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback>) client -> { @@ -215,7 +215,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { public byte[] randomKey(RedisClusterNode node) { - Assert.notNull(node, "RedisClusterNode must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.randomBinaryKey(), node) @@ -225,8 +225,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public void rename(byte[] oldKey, byte[] newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(oldKey, newKey)) { @@ -250,8 +250,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean renameNX(byte[] sourceKey, byte[] targetKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Target key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Target key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sourceKey, targetKey)) { @@ -276,7 +276,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean expire(byte[] key, long seconds) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().expire(key, seconds)); @@ -288,7 +288,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean pExpire(byte[] key, long millis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().pexpire(key, millis)); @@ -300,7 +300,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean expireAt(byte[] key, long unixTime) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().expireAt(key, unixTime)); @@ -312,7 +312,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean pExpireAt(byte[] key, long unixTimeInMillis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().pexpireAt(key, unixTimeInMillis)); @@ -324,7 +324,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean persist(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().persist(key)); @@ -335,13 +335,13 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Boolean move(byte[] key, int dbIndex) { - throw new InvalidDataAccessApiUsageException("Cluster mode does not allow moving keys."); + throw new InvalidDataAccessApiUsageException("Cluster mode does not allow moving keys"); } @Override public Long ttl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().ttl(key); @@ -353,7 +353,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long ttl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return Converters.secondsToTimeUnit(connection.getCluster().ttl(key), timeUnit); @@ -365,7 +365,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.pttl(key), @@ -376,7 +376,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode( @@ -388,7 +388,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public byte[] dump(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.dump(key), @@ -399,8 +399,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(serializedValue, "Serialized value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(serializedValue, "Serialized value must not be null"); connection.getClusterCommandExecutor().executeCommandOnSingleNode((JedisClusterCommandCallback) client -> { @@ -417,7 +417,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public List sort(byte[] key, SortParameters params) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().sort(key, JedisConverters.toSortingParams(params)); @@ -429,7 +429,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long sort(byte[] key, SortParameters params, byte[] storeKey) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); List sorted = sort(key, params); if (!CollectionUtils.isEmpty(sorted)) { @@ -454,8 +454,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long exists(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -474,7 +474,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public ValueEncoding encodingOf(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.objectEncoding(key), @@ -486,7 +486,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Duration idletime(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.objectIdletime(key), @@ -498,7 +498,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands { @Override public Long refcount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((JedisClusterCommandCallback) client -> client.objectRefcount(key), diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java index 82052d9cd..d9dba4b3c 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterListCommands.java @@ -48,7 +48,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long rPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().rpush(key, values); @@ -60,8 +60,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List lPos(byte[] key, byte[] element, @Nullable Integer rank, @Nullable Integer count) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(element, "Element must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(element, "Element must not be null"); LPosParams params = new LPosParams(); if (rank != null) { @@ -84,9 +84,9 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long lPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); try { return connection.getCluster().lpush(key, values); @@ -98,8 +98,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long rPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().rpushx(key, value); @@ -111,8 +111,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long lPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().lpushx(key, value); @@ -124,7 +124,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long lLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().llen(key); @@ -136,7 +136,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List lRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().lrange(key, start, end); @@ -148,7 +148,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public void lTrim(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { connection.getCluster().ltrim(key, start, end); @@ -160,7 +160,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] lIndex(byte[] key, long index) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().lindex(key, index); @@ -172,7 +172,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().linsert(key, JedisConverters.toListPosition(where), pivot, value); @@ -184,10 +184,10 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] lMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); try { return connection.getCluster().lmove(sourceKey, destinationKey, ListDirection.valueOf(from.name()), @@ -200,10 +200,10 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] bLMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to, double timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); try { return connection.getCluster().blmove(sourceKey, destinationKey, ListDirection.valueOf(from.name()), @@ -216,8 +216,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public void lSet(byte[] key, long index, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { connection.getCluster().lset(key, index, value); @@ -229,8 +229,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public Long lRem(byte[] key, long count, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().lrem(key, count, value); @@ -242,7 +242,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] lPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().lpop(key); @@ -254,7 +254,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List lPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().lpop(key, (int) count); @@ -266,7 +266,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] rPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().rpop(key); @@ -278,7 +278,7 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List rPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().rpop(key, (int) count); @@ -290,8 +290,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List bLPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -311,8 +311,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public List bRPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -332,8 +332,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { @@ -351,8 +351,8 @@ class JedisClusterListCommands implements RedisListCommands { @Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterScriptingCommands.java index d55dd8a3b..6c425b677 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterScriptingCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterScriptingCommands.java @@ -64,7 +64,7 @@ class JedisClusterScriptingCommands implements RedisScriptingCommands { @Override public String scriptLoad(byte[] script) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); try { ClusterCommandExecutor.MultiNodeResult multiNodeResult = connection.getClusterCommandExecutor() @@ -79,14 +79,14 @@ class JedisClusterScriptingCommands implements RedisScriptingCommands { @Override public List scriptExists(String... scriptShas) { - throw new InvalidDataAccessApiUsageException("ScriptExists is not supported in cluster environment."); + throw new InvalidDataAccessApiUsageException("ScriptExists is not supported in cluster environment"); } @Override @SuppressWarnings("unchecked") public T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); try { return (T) new JedisScriptReturnConverter(returnType).convert(getCluster().eval(script, numKeys, keysAndArgs)); @@ -104,7 +104,7 @@ class JedisClusterScriptingCommands implements RedisScriptingCommands { @SuppressWarnings("unchecked") public T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(scriptSha, "Script digest must not be null!"); + Assert.notNull(scriptSha, "Script digest must not be null"); try { return (T) new JedisScriptReturnConverter(returnType) diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java index 015570739..96bfdad81 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java @@ -191,7 +191,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public Properties info(String section) { - Assert.notNull(section, "Section must not be null!"); + Assert.notNull(section, "Section must not be null"); Properties infos = new Properties(); @@ -212,7 +212,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public Properties info(RedisClusterNode node, String section) { - Assert.notNull(section, "Section must not be null!"); + Assert.notNull(section, "Section must not be null"); return JedisConverters.toProperties(executeCommandOnSingleNode(client -> client.info(section), node).getValue()); } @@ -241,13 +241,13 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { return; } - throw new IllegalArgumentException("Shutdown with options is not supported for jedis."); + throw new IllegalArgumentException("Shutdown with options is not supported for jedis"); } @Override public Properties getConfig(String pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); List>> mapResult = connection.getClusterCommandExecutor() .executeCommandOnAllNodes((JedisClusterCommandCallback>) client -> client.configGet(pattern)) @@ -269,7 +269,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public Properties getConfig(RedisClusterNode node, String pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode( @@ -281,8 +281,8 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void setConfig(String param, String value) { - Assert.notNull(param, "Parameter must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(param, "Parameter must not be null"); + Assert.notNull(value, "Value must not be null"); connection.getClusterCommandExecutor() .executeCommandOnAllNodes((JedisClusterCommandCallback) client -> client.configSet(param, value)); @@ -291,8 +291,8 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void setConfig(RedisClusterNode node, String param, String value) { - Assert.notNull(param, "Parameter must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(param, "Parameter must not be null"); + Assert.notNull(value, "Value must not be null"); executeCommandOnSingleNode(client -> client.configSet(param, value), node); } @@ -340,7 +340,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void killClient(String host, int port) { - Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'."); + Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'"); String hostAndPort = String.format("%s:%s", host, port); connection.getClusterCommandExecutor() @@ -349,12 +349,12 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void setClientName(byte[] name) { - throw new InvalidDataAccessApiUsageException("CLIENT SETNAME is not supported in cluster environment."); + throw new InvalidDataAccessApiUsageException("CLIENT SETNAME is not supported in cluster environment"); } @Override public String getClientName() { - throw new InvalidDataAccessApiUsageException("CLIENT GETNAME is not supported in cluster environment."); + throw new InvalidDataAccessApiUsageException("CLIENT GETNAME is not supported in cluster environment"); } @Override @@ -380,13 +380,13 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void replicaOf(String host, int port) { throw new InvalidDataAccessApiUsageException( - "REPLICAOF is not supported in cluster environment. Please use CLUSTER REPLICATE."); + "REPLICAOF is not supported in cluster environment; Please use CLUSTER REPLICATE"); } @Override public void replicaOfNoOne() { throw new InvalidDataAccessApiUsageException( - "REPLICAOF is not supported in cluster environment. Please use CLUSTER REPLICATE."); + "REPLICAOF is not supported in cluster environment; Please use CLUSTER REPLICATE"); } @Override @@ -397,8 +397,8 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(target, "Target node must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(target, "Target node must not be null"); int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE; RedisClusterNode node = connection.getTopologyProvider().getTopology().lookup(target.getHost(), target.getPort()); @@ -409,9 +409,9 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { private Long convertListOfStringToTime(List serverTimeInformation, TimeUnit timeUnit) { - Assert.notEmpty(serverTimeInformation, "Received invalid result from server. Expected 2 items in collection."); + Assert.notEmpty(serverTimeInformation, "Received invalid result from server; Expected 2 items in collection"); Assert.isTrue(serverTimeInformation.size() == 2, - "Received invalid number of arguments from redis server. Expected 2 received " + serverTimeInformation.size()); + "Received invalid number of arguments from redis server; Expected 2 received " + serverTimeInformation.size()); return Converters.toTimeMillis(serverTimeInformation.get(0), serverTimeInformation.get(1), timeUnit); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterSetCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterSetCommands.java index b4698c240..9e00a58da 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterSetCommands.java @@ -53,9 +53,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sAdd(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); try { return connection.getCluster().sadd(key, values); @@ -67,9 +67,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); try { return connection.getCluster().srem(key, values); @@ -81,7 +81,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public byte[] sPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().spop(key); @@ -93,7 +93,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public List sPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new ArrayList<>(connection.getCluster().spop(key, count)); @@ -105,9 +105,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(value, "Value must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, destKey)) { try { @@ -128,7 +128,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().scard(key); @@ -140,8 +140,8 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Boolean sIsMember(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().sismember(key, value); @@ -153,9 +153,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public List sMIsMember(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Value must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Value must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); try { return connection.getCluster().smismember(key, values); @@ -167,8 +167,8 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Set sInter(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -209,9 +209,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sInterStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); @@ -233,8 +233,8 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Set sUnion(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -265,9 +265,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sUnionStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); @@ -289,8 +289,8 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Set sDiff(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { try { @@ -324,9 +324,9 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Long sDiffStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); @@ -349,7 +349,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Set sMembers(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().smembers(key); @@ -361,7 +361,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public byte[] sRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().srandmember(key); @@ -373,10 +373,10 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public List sRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count cannot exceed Integer.MAX_VALUE"); } try { @@ -389,7 +389,7 @@ class JedisClusterSetCommands implements RedisSetCommands { @Override public Cursor sScan(byte[] key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ScanCursor(options) { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStreamCommands.java index e73c7c498..004210fb8 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStreamCommands.java @@ -59,9 +59,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Long xAck(byte[] key, String group, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(group, "Group name must not be null or empty!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(group, "Group name must not be null or empty"); + Assert.notNull(recordIds, "recordIds must not be null"); try { return connection.getCluster().xack(key, JedisConverters.toBytes(group), @@ -74,8 +74,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public RecordId xAdd(MapRecord record, XAddOptions options) { - Assert.notNull(record, "Record must not be null!"); - Assert.notNull(record.getStream(), "Stream must not be null!"); + Assert.notNull(record, "Record must not be null"); + Assert.notNull(record.getStream(), "Stream must not be null"); XAddParams params = StreamConverters.toXAddParams(record.getId(), options); @@ -90,9 +90,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public List xClaimJustId(byte[] key, String group, String newOwner, XClaimOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); - Assert.notNull(newOwner, "NewOwner must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); + Assert.notNull(newOwner, "NewOwner must not be null"); long minIdleTime = options.getMinIdleTime() == null ? -1L : options.getMinIdleTime().toMillis(); @@ -114,9 +114,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public List xClaim(byte[] key, String group, String newOwner, XClaimOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); - Assert.notNull(newOwner, "NewOwner must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); + Assert.notNull(newOwner, "NewOwner must not be null"); long minIdleTime = options.getMinIdleTime() == null ? -1L : options.getMinIdleTime().toMillis(); @@ -132,8 +132,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Long xDel(byte[] key, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "recordIds must not be null"); try { return connection.getCluster().xdel(key, entryIdsToBytes(Arrays.asList(recordIds))); @@ -150,9 +150,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public String xGroupCreate(byte[] key, String groupName, ReadOffset readOffset, boolean mkStream) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); - Assert.notNull(readOffset, "ReadOffset must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); + Assert.notNull(readOffset, "ReadOffset must not be null"); try { return connection.getCluster().xgroupCreate(key, JedisConverters.toBytes(groupName), @@ -165,8 +165,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDelConsumer(byte[] key, Consumer consumer) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); try { return connection.getCluster().xgroupDelConsumer(key, JedisConverters.toBytes(consumer.getGroup()), @@ -179,8 +179,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDestroy(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); try { return connection.getCluster().xgroupDestroy(key, JedisConverters.toBytes(groupName)) != 0L; @@ -192,7 +192,7 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoStream xInfo(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return StreamInfo.XInfoStream.fromList((List) connection.getCluster().xinfoStream(key)); @@ -204,7 +204,7 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoGroups xInfoGroups(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return StreamInfo.XInfoGroups.fromList(connection.getCluster().xinfoGroups(key)); @@ -216,8 +216,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoConsumers xInfoConsumers(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); try { return StreamInfo.XInfoConsumers.fromList(groupName, @@ -230,7 +230,7 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Long xLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().xlen(key); @@ -242,8 +242,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public PendingMessagesSummary xPending(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); byte[] group = JedisConverters.toBytes(groupName); @@ -261,8 +261,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public PendingMessages xPending(byte[] key, String groupName, XPendingOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); Range range = (Range) options.getRange(); byte[] group = JedisConverters.toBytes(groupName); @@ -283,9 +283,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public List xRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); int count = limit.isUnlimited() ? Integer.MAX_VALUE : limit.getCount(); @@ -300,8 +300,8 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public List xRead(StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadParams xReadParams = StreamConverters.toXReadParams(readOptions); @@ -323,9 +323,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { public List xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadGroupParams xReadParams = StreamConverters.toXReadGroupParams(readOptions); @@ -347,9 +347,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public List xRevRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); int count = limit.isUnlimited() ? Integer.MAX_VALUE : limit.getCount(); @@ -369,7 +369,7 @@ class JedisClusterStreamCommands implements RedisStreamCommands { @Override public Long xTrim(byte[] key, long count, boolean approximateTrimming) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().xtrim(key, count, approximateTrimming); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStringCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStringCommands.java index 617fbc52c..313106576 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterStringCommands.java @@ -55,7 +55,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public byte[] get(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().get(key); @@ -68,7 +68,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public byte[] getDel(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().getDel(key); @@ -81,8 +81,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public byte[] getEx(byte[] key, Expiration expiration) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); try { return connection.getCluster().getEx(key, JedisConverters.toGetExParams(expiration)); @@ -94,8 +94,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public byte[] getSet(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().getSet(key, value); @@ -107,8 +107,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public List mGet(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return connection.getCluster().mget(keys); @@ -122,8 +122,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return Converters.stringToBoolean(connection.getCluster().set(key, value)); @@ -135,10 +135,10 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value, Expiration expiration, SetOption option) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); - Assert.notNull(option, "Option must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); + Assert.notNull(option, "Option must not be null"); SetParams setParams = JedisConverters.toSetCommandExPxArgument(expiration, JedisConverters.toSetCommandNxXxArgument(option)); @@ -153,8 +153,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean setNX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return JedisConverters.toBoolean(connection.getCluster().setnx(key, value)); @@ -166,11 +166,11 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean setEx(byte[] key, long seconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); if (seconds > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Seconds have cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Seconds have cannot exceed Integer.MAX_VALUE"); } try { @@ -183,8 +183,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean pSetEx(byte[] key, long milliseconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return Converters.stringToBoolean(connection.getCluster().psetex(key, milliseconds, value)); @@ -196,7 +196,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean mSet(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(tuples.keySet().toArray(new byte[tuples.keySet().size()][]))) { try { @@ -218,7 +218,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean mSetNX(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(tuples.keySet().toArray(new byte[tuples.keySet().size()][]))) { try { @@ -240,7 +240,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long incr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().incr(key); @@ -252,7 +252,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long incrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().incrBy(key, value); @@ -264,7 +264,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Double incrBy(byte[] key, double value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().incrByFloat(key, value); @@ -276,7 +276,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long decr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().decr(key); @@ -288,7 +288,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long decrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().decrBy(key, value); @@ -300,8 +300,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long append(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().append(key, value); @@ -313,7 +313,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public byte[] getRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().getrange(key, start, end); @@ -325,8 +325,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public void setRange(byte[] key, byte[] value, long offset) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { connection.getCluster().setrange(key, offset, value); @@ -338,7 +338,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean getBit(byte[] key, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().getbit(key, offset); @@ -350,7 +350,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Boolean setBit(byte[] key, long offset, boolean value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().setbit(key, offset, value); @@ -362,7 +362,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().bitcount(key); @@ -374,7 +374,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().bitcount(key, start, end); @@ -386,8 +386,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public List bitField(byte[] key, BitFieldSubCommands subCommands) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(subCommands, "Command must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(subCommands, "Command must not be null"); byte[][] args = JedisConverters.toBitfieldCommandArguments(subCommands); @@ -401,8 +401,8 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long bitOp(BitOperation op, byte[] destination, byte[]... keys) { - Assert.notNull(op, "BitOperation must not be null!"); - Assert.notNull(destination, "Destination key must not be null!"); + Assert.notNull(op, "BitOperation must not be null"); + Assert.notNull(destination, "Destination key must not be null"); byte[][] allKeys = ByteUtils.mergeArrays(destination, keys); @@ -414,14 +414,14 @@ class JedisClusterStringCommands implements RedisStringCommands { } } - throw new InvalidDataAccessApiUsageException("BITOP is only supported for same slot keys in cluster mode."); + throw new InvalidDataAccessApiUsageException("BITOP is only supported for same slot keys in cluster mode"); } @Override public Long bitPos(byte[] key, boolean bit, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null! Use Range.unbounded() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null Use Range.unbounded() instead"); List args = new ArrayList<>(3); args.add(LettuceConverters.toBit(bit)); @@ -438,7 +438,7 @@ class JedisClusterStringCommands implements RedisStringCommands { @Override public Long strLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().strlen(key); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterZSetCommands.java index ba69c3e13..f2af0bd7c 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterZSetCommands.java @@ -63,8 +63,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Boolean zAdd(byte[] key, double score, byte[] value, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return JedisConverters @@ -77,8 +77,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zAdd(byte[] key, Set tuples, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(tuples, "Tuples must not be null"); try { return connection.getCluster().zadd(key, JedisConverters.toTupleMap(tuples), JedisConverters.toZAddParams(args)); @@ -90,9 +90,9 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); try { return connection.getCluster().zrem(key, values); @@ -105,8 +105,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Double zIncrBy(byte[] key, double increment, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().zincrby(key, increment, value); @@ -118,7 +118,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public byte[] zRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().zrandmember(key); @@ -130,7 +130,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public List zRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new ArrayList<>(connection.getCluster().zrandmember(key, count)); @@ -142,7 +142,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Tuple zRandMemberWithScore(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { List tuples = connection.getCluster().zrandmemberWithScores(key, 1); @@ -156,7 +156,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public List zRandMemberWithScore(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { List tuples = connection.getCluster().zrandmemberWithScores(key, count); @@ -170,8 +170,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().zrank(key, value); @@ -183,8 +183,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRevRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().zrevrank(key, value); @@ -196,7 +196,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new LinkedHashSet<>(connection.getCluster().zrange(key, start, end)); @@ -209,8 +209,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZRANGEBYSCOREWITHSCORES."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZRANGEBYSCOREWITHSCORES"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -232,8 +232,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRevRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZREVRANGEBYSCORE."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZREVRANGEBYSCORE"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -255,8 +255,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZREVRANGEBYSCOREWITHSCORES."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZREVRANGEBYSCOREWITHSCORES"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -277,8 +277,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZCOUNT."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZCOUNT"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -295,8 +295,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zLexCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -312,7 +312,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMin(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { redis.clients.jedis.resps.Tuple tuple = connection.getCluster().zpopmin(key); @@ -326,7 +326,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zPopMin(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zpopmin(key, Math.toIntExact(count))); @@ -339,8 +339,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMin(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); try { return toTuple(connection.getCluster().bzpopmin(JedisConverters.toSeconds(timeout, unit), key)); @@ -353,7 +353,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMax(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { redis.clients.jedis.resps.Tuple tuple = connection.getCluster().zpopmax(key); @@ -367,7 +367,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zPopMax(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zpopmax(key, Math.toIntExact(count))); @@ -380,8 +380,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMax(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); try { return toTuple(connection.getCluster().bzpopmax(JedisConverters.toSeconds(timeout, unit), key)); @@ -393,8 +393,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByScore(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZREMRANGEBYSCORE."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZREMRANGEBYSCORE"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -413,8 +413,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range cannot be null for ZRANGEBYSCORE."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range cannot be null for ZRANGEBYSCORE"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -436,9 +436,9 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null for ZRANGEBYLEX!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null for ZRANGEBYLEX"); + Assert.notNull(limit, "Limit must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -457,8 +457,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByLex(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -474,9 +474,9 @@ class JedisClusterZSetCommands implements RedisZSetCommands { public Set zRevRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null for ZREVRANGEBYLEX!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null for ZREVRANGEBYLEX"); + Assert.notNull(limit, "Limit must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -495,7 +495,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zrangeWithScores(key, start, end)); @@ -507,7 +507,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new LinkedHashSet<>(connection.getCluster().zrangeByScore(key, min, max)); @@ -519,7 +519,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScoreWithScores(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zrangeByScoreWithScores(key, min, max)); @@ -531,10 +531,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, double min, double max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE"); } try { @@ -548,10 +548,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE"); } try { @@ -565,7 +565,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new LinkedHashSet<>(connection.getCluster().zrevrange(key, start, end)); @@ -577,7 +577,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zrevrangeWithScores(key, start, end)); @@ -589,7 +589,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeByScore(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new LinkedHashSet<>(connection.getCluster().zrevrangeByScore(key, max, min)); @@ -601,7 +601,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeByScoreWithScores(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return toTupleSet(connection.getCluster().zrevrangeByScoreWithScores(key, max, min)); @@ -613,10 +613,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeByScore(byte[] key, double min, double max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE"); } try { @@ -630,10 +630,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE"); } try { @@ -647,7 +647,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zCount(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().zcount(key, min, max); @@ -659,7 +659,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().zcard(key); @@ -671,8 +671,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Double zScore(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); try { return connection.getCluster().zscore(key, value); @@ -684,8 +684,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public List zMScore(byte[] key, byte[][] values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); try { return connection.getCluster().zmscore(key, values); @@ -697,7 +697,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRemRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().zremrangeByRank(key, start, end); @@ -709,7 +709,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByScore(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return connection.getCluster().zremrangeByScore(key, min, max); @@ -721,7 +721,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zDiff(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -738,7 +738,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zDiffWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -755,8 +755,8 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zDiffStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, sets); @@ -775,7 +775,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zInter(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -792,7 +792,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -809,10 +809,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -830,9 +830,9 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, sets); @@ -851,11 +851,11 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); byte[][] allKeys = ByteUtils.mergeArrays(destKey, sets); @@ -874,7 +874,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zUnion(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -891,7 +891,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -908,10 +908,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sets)) { @@ -929,9 +929,9 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, sets); @@ -950,11 +950,11 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); byte[][] allKeys = ByteUtils.mergeArrays(destKey, sets); @@ -975,7 +975,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Cursor zScan(byte[] key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new ScanCursor(options) { @@ -995,7 +995,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); try { return new LinkedHashSet<>( @@ -1008,10 +1008,10 @@ class JedisClusterZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!"); + throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE"); } try { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java index 0ec7bf8ab..33f74d87d 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java @@ -271,8 +271,8 @@ public class JedisConnection extends AbstractRedisConnection { @Override public Object execute(String command, byte[]... args) { - Assert.hasText(command, "A valid command needs to be specified!"); - Assert.notNull(args, "Arguments must not be null!"); + Assert.hasText(command, "A valid command needs to be specified"); + Assert.notNull(args, "Arguments must not be null"); return doWithJedis(it -> { @@ -447,7 +447,7 @@ public class JedisConnection extends AbstractRedisConnection { try { if (transaction == null) { - throw new InvalidDataAccessApiUsageException("No ongoing transaction. Did you forget to call multi?"); + throw new InvalidDataAccessApiUsageException("No ongoing transaction; Did you forget to call multi"); } List results = transaction.exec(); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java index 93ddc1c78..730bb1d55 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java @@ -122,7 +122,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, */ private JedisConnectionFactory(JedisClientConfiguration clientConfig) { - Assert.notNull(clientConfig, "JedisClientConfiguration must not be null!"); + Assert.notNull(clientConfig, "JedisClientConfiguration must not be null"); this.clientConfiguration = clientConfig; } @@ -182,7 +182,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, */ public JedisConnectionFactory(RedisClusterConfiguration clusterConfig, JedisPoolConfig poolConfig) { - Assert.notNull(clusterConfig, "RedisClusterConfiguration must not be null!"); + Assert.notNull(clusterConfig, "RedisClusterConfiguration must not be null"); this.configuration = clusterConfig; this.clientConfiguration = MutableJedisClientConfiguration.create(poolConfig); @@ -210,7 +210,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, this(clientConfig); - Assert.notNull(standaloneConfig, "RedisStandaloneConfiguration must not be null!"); + Assert.notNull(standaloneConfig, "RedisStandaloneConfiguration must not be null"); this.standaloneConfig = standaloneConfig; } @@ -227,7 +227,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, this(clientConfig); - Assert.notNull(sentinelConfig, "RedisSentinelConfiguration must not be null!"); + Assert.notNull(sentinelConfig, "RedisSentinelConfiguration must not be null"); this.configuration = sentinelConfig; } @@ -244,7 +244,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, this(clientConfig); - Assert.notNull(clusterConfig, "RedisClusterConfiguration must not be null!"); + Assert.notNull(clusterConfig, "RedisClusterConfiguration must not be null"); this.configuration = clusterConfig; } @@ -401,7 +401,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, protected JedisCluster createCluster(RedisClusterConfiguration clusterConfig, GenericObjectPoolConfig poolConfig) { - Assert.notNull(clusterConfig, "Cluster configuration must not be null!"); + Assert.notNull(clusterConfig, "Cluster configuration must not be null"); Set hostAndPort = new HashSet<>(); for (RedisNode node : clusterConfig.getClusterNodes()) { @@ -471,7 +471,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, assertInitialized(); if (!isRedisClusterAware()) { - throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); + throw new InvalidDataAccessApiUsageException("Cluster is not configured"); } return new JedisClusterConnection(this.cluster, this.clusterCommandExecutor, this.topologyProvider); } @@ -635,7 +635,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, public void setUsePool(boolean usePool) { if (isRedisSentinelAware() && !usePool) { - throw new IllegalStateException("Jedis requires pooling for Redis Sentinel use!"); + throw new IllegalStateException("Jedis requires pooling for Redis Sentinel use"); } getMutableConfiguration().setUsePooling(usePool); @@ -805,7 +805,7 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, private Jedis getActiveSentinel() { - Assert.isTrue(RedisConfiguration.isSentinelConfiguration(configuration), "SentinelConfig must not be null!"); + Assert.isTrue(RedisConfiguration.isSentinelConfiguration(configuration), "SentinelConfig must not be null"); SentinelConfiguration sentinelConfiguration = (SentinelConfiguration) configuration; JedisClientConfig clientConfig = createSentinelClientConfig(sentinelConfiguration); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java index 429a143d0..8673bd64b 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java @@ -150,7 +150,7 @@ abstract class JedisConverters extends Converters { */ public static Map toTupleMap(Set tuples) { - Assert.notNull(tuples, "Tuple set must not be null!"); + Assert.notNull(tuples, "Tuple set must not be null"); Map args = new LinkedHashMap<>(tuples.size(), 1); @@ -523,10 +523,10 @@ abstract class JedisConverters extends Converters { static Long toTime(List source, TimeUnit timeUnit) { - Assert.notEmpty(source, "Received invalid result from server. Expected 2 items in collection."); + Assert.notEmpty(source, "Received invalid result from server; Expected 2 items in collection"); Assert.isTrue(source.size() == 2, - "Received invalid nr of arguments from redis server. Expected 2 received " + source.size()); - Assert.notNull(timeUnit, "TimeUnit must not be null."); + "Received invalid nr of arguments from redis server; Expected 2 received " + source.size()); + Assert.notNull(timeUnit, "TimeUnit must not be null"); return toTimeMillis(source.get(0), source.get(1), timeUnit); } @@ -759,16 +759,16 @@ abstract class JedisConverters extends Converters { case SYNC: return FlushMode.SYNC; default: - throw new IllegalArgumentException("Flush option " + option + " is not supported."); + throw new IllegalArgumentException("Flush option " + option + " is not supported"); } } static GeoSearchParam toGeoSearchParams(GeoReference reference, GeoShape predicate, RedisGeoCommands.GeoCommandArgs args) { - Assert.notNull(reference, "GeoReference must not be null!"); - Assert.notNull(predicate, "GeoShape must not be null!"); - Assert.notNull(args, "GeoSearchCommandArgs must not be null!"); + Assert.notNull(reference, "GeoReference must not be null"); + Assert.notNull(predicate, "GeoShape must not be null"); + Assert.notNull(args, "GeoSearchCommandArgs must not be null"); GeoSearchParam param = GeoSearchParam.geoSearchParam(); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverter.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverter.java index b3c34969f..1eeaaa107 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverter.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverter.java @@ -53,7 +53,7 @@ public class JedisExceptionConverter implements Converter memberCoordinateMap) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null"); Map redisGeoCoordinateMap = new HashMap<>(); @@ -78,8 +78,8 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Iterable> locations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(locations, "Locations must not be null"); Map redisGeoCoordinateMap = new HashMap<>(); @@ -93,9 +93,9 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public Distance geoDist(byte[] key, byte[] member1, byte[] member2) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member1 must not be null!"); - Assert.notNull(member2, "Member2 must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member1 must not be null"); + Assert.notNull(member2, "Member2 must not be null"); Converter distanceConverter = JedisConverters.distanceConverterForMetric(DistanceUnit.METERS); @@ -106,10 +106,10 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member1 must not be null!"); - Assert.notNull(member2, "Member2 must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member1 must not be null"); + Assert.notNull(member2, "Member2 must not be null"); + Assert.notNull(metric, "Metric must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(metric); Converter distanceConverter = JedisConverters.distanceConverterForMetric(metric); @@ -121,9 +121,9 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public List geoHash(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); return connection.invoke().fromMany(Jedis::geohash, PipelineBinaryCommands::geohash, key, members) .toList(JedisConverters::toString); @@ -132,9 +132,9 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public List geoPos(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); return connection.invoke().fromMany(Jedis::geopos, PipelineBinaryCommands::geopos, key, members) .toList(JedisConverters::toPoint); @@ -143,8 +143,8 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); Converter, GeoResults>> converter = JedisConverters .geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric()); @@ -159,9 +159,9 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); + Assert.notNull(args, "Args must not be null"); redis.clients.jedis.params.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args); Converter, GeoResults>> converter = JedisConverters @@ -177,9 +177,9 @@ class JedisGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric()); Converter, GeoResults>> converter = JedisConverters @@ -193,10 +193,10 @@ class JedisGeoCommands implements RedisGeoCommands { public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); + Assert.notNull(args, "Args must not be null"); GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric()); Converter, GeoResults>> converter = JedisConverters @@ -216,7 +216,7 @@ class JedisGeoCommands implements RedisGeoCommands { public GeoResults> geoSearch(byte[] key, GeoReference reference, GeoShape predicate, GeoSearchCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); GeoSearchParam param = JedisConverters.toGeoSearchParams(reference, predicate, args); Converter, GeoResults>> converter = JedisConverters @@ -229,8 +229,8 @@ class JedisGeoCommands implements RedisGeoCommands { public Long geoSearchStore(byte[] destKey, byte[] key, GeoReference reference, GeoShape predicate, GeoSearchStoreCommandArgs args) { - Assert.notNull(destKey, "Destination Key must not be null!"); - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(destKey, "Destination Key must not be null"); + Assert.notNull(key, "Key must not be null"); GeoSearchParam param = JedisConverters.toGeoSearchParams(reference, predicate, args); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisHashCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisHashCommands.java index 01310e126..c63171e32 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisHashCommands.java @@ -52,9 +52,9 @@ class JedisHashCommands implements RedisHashCommands { @Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::hset, PipelineBinaryCommands::hset, key, field, value) .get(JedisConverters.longToBoolean()); @@ -63,9 +63,9 @@ class JedisHashCommands implements RedisHashCommands { @Override public Boolean hSetNX(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::hsetnx, PipelineBinaryCommands::hsetnx, key, field, value) .get(JedisConverters.longToBoolean()); @@ -74,8 +74,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public Long hDel(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return connection.invoke().just(Jedis::hdel, PipelineBinaryCommands::hdel, key, fields); } @@ -83,8 +83,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public Boolean hExists(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Fields must not be null"); return connection.invoke().just(Jedis::hexists, PipelineBinaryCommands::hexists, key, field); } @@ -92,8 +92,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public byte[] hGet(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(Jedis::hget, PipelineBinaryCommands::hget, key, field); } @@ -101,7 +101,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public Map hGetAll(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hgetAll, PipelineBinaryCommands::hgetAll, key); } @@ -110,7 +110,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public byte[] hRandField(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hrandfield, PipelineBinaryCommands::hrandfield, key); } @@ -119,7 +119,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public Entry hRandFieldWithValues(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::hrandfieldWithValues, PipelineBinaryCommands::hrandfieldWithValues, key, 1L) .get(it -> it.isEmpty() ? null : it.entrySet().iterator().next()); @@ -129,7 +129,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public List hRandField(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hrandfield, PipelineBinaryCommands::hrandfield, key, count); } @@ -138,7 +138,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public List> hRandFieldWithValues(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .from(Jedis::hrandfieldWithValues, PipelineBinaryCommands::hrandfieldWithValues, key, count).get(it -> { @@ -153,8 +153,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public Long hIncrBy(byte[] key, byte[] field, long delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(Jedis::hincrBy, PipelineBinaryCommands::hincrBy, key, field, delta); } @@ -162,8 +162,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public Double hIncrBy(byte[] key, byte[] field, double delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(Jedis::hincrByFloat, PipelineBinaryCommands::hincrByFloat, key, field, delta); } @@ -171,7 +171,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public Set hKeys(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hkeys, PipelineBinaryCommands::hkeys, key); } @@ -179,7 +179,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public Long hLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hlen, PipelineBinaryCommands::hlen, key); } @@ -187,8 +187,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public List hMGet(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return connection.invoke().just(Jedis::hmget, PipelineBinaryCommands::hmget, key, fields); } @@ -196,8 +196,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public void hMSet(byte[] key, Map hashes) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashes, "Hashes must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashes, "Hashes must not be null"); connection.invokeStatus().just(Jedis::hmset, PipelineBinaryCommands::hmset, key, hashes); } @@ -205,7 +205,7 @@ class JedisHashCommands implements RedisHashCommands { @Override public List hVals(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::hvals, PipelineBinaryCommands::hvals, key); } @@ -224,7 +224,7 @@ class JedisHashCommands implements RedisHashCommands { */ public Cursor> hScan(byte[] key, long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor>(key, cursorId, options) { @@ -232,7 +232,7 @@ class JedisHashCommands implements RedisHashCommands { protected ScanIteration> doScan(byte[] key, long cursorId, ScanOptions options) { if (isQueueing() || isPipelined()) { - throw new InvalidDataAccessApiUsageException("'HSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'HSCAN' cannot be called in pipeline / transaction mode"); } ScanParams params = JedisConverters.toScanParams(options); @@ -254,8 +254,8 @@ class JedisHashCommands implements RedisHashCommands { @Override public Long hStrLen(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(Jedis::hstrlen, PipelineBinaryCommands::hstrlen, key, field); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisHyperLogLogCommands.java index 7be462058..8adafa77c 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisHyperLogLogCommands.java @@ -37,8 +37,8 @@ class JedisHyperLogLogCommands implements RedisHyperLogLogCommands { @Override public Long pfAdd(byte[] key, byte[]... values) { - Assert.notEmpty(values, "PFADD requires at least one non 'null' value."); - Assert.noNullElements(values, "Values for PFADD must not contain 'null'."); + Assert.notEmpty(values, "PFADD requires at least one non 'null' value"); + Assert.noNullElements(values, "Values for PFADD must not contain 'null'"); return connection.invoke().just(Jedis::pfadd, PipelineBinaryCommands::pfadd, key, values); } @@ -46,8 +46,8 @@ class JedisHyperLogLogCommands implements RedisHyperLogLogCommands { @Override public Long pfCount(byte[]... keys) { - Assert.notEmpty(keys, "PFCOUNT requires at least one non 'null' key."); - Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'."); + Assert.notEmpty(keys, "PFCOUNT requires at least one non 'null' key"); + Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'"); return connection.invoke().just(Jedis::pfcount, PipelineBinaryCommands::pfcount, keys); } @@ -57,7 +57,7 @@ class JedisHyperLogLogCommands implements RedisHyperLogLogCommands { Assert.notNull(destinationKey, "Destination key must not be null"); Assert.notNull(sourceKeys, "Source keys must not be null"); - Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'."); + Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'"); connection.invoke().just(Jedis::pfmerge, PipelineBinaryCommands::pfmerge, destinationKey, sourceKeys); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java index a93876625..ff5b00ede 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java @@ -80,7 +80,7 @@ class JedisInvoker { @Nullable R just(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(function::apply, it -> { throw new InvalidDataAccessApiUsageException("Operation not supported by Jedis in pipelining/transaction mode"); @@ -96,8 +96,8 @@ class JedisInvoker { @Nullable R just(ConnectionFunction0 function, PipelineFunction0 pipelineFunction) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(function::apply, pipelineFunction::apply, Converters.identityConverter(), () -> null); } @@ -112,8 +112,8 @@ class JedisInvoker { @Nullable R just(ConnectionFunction1 function, PipelineFunction1 pipelineFunction, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1)); } @@ -130,8 +130,8 @@ class JedisInvoker { R just(ConnectionFunction2 function, PipelineFunction2 pipelineFunction, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2)); } @@ -149,8 +149,8 @@ class JedisInvoker { R just(ConnectionFunction3 function, PipelineFunction3 pipelineFunction, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3)); } @@ -169,8 +169,8 @@ class JedisInvoker { R just(ConnectionFunction4 function, PipelineFunction4 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1, t2, t3, t4), it -> pipelineFunction.apply(it, t1, t2, t3, t4)); @@ -191,8 +191,8 @@ class JedisInvoker { R just(ConnectionFunction5 function, PipelineFunction5 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1, t2, t3, t4, t5), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5)); @@ -214,8 +214,8 @@ class JedisInvoker { R just(ConnectionFunction6 function, PipelineFunction6 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return synchronizer.invoke(it -> function.apply(it, t1, t2, t3, t4, t5, t6), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6)); @@ -229,7 +229,7 @@ class JedisInvoker { */ SingleInvocationSpec from(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(function, connection -> { throw new InvalidDataAccessApiUsageException("Operation not supported in pipelining/transaction mode"); @@ -245,8 +245,8 @@ class JedisInvoker { */ SingleInvocationSpec from(ConnectionFunction0 function, PipelineFunction0 pipelineFunction) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return new DefaultSingleInvocationSpec<>(function::apply, pipelineFunction::apply, synchronizer); } @@ -262,8 +262,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction1 function, PipelineFunction1 pipelineFunction, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1)); } @@ -280,8 +280,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction2 function, PipelineFunction2 pipelineFunction, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2)); } @@ -299,8 +299,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction3 function, PipelineFunction3 pipelineFunction, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3)); } @@ -319,8 +319,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction4 function, PipelineFunction4 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3, t4), it -> pipelineFunction.apply(it, t1, t2, t3, t4)); } @@ -340,8 +340,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction5 function, PipelineFunction5 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3, t4, t5), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5)); } @@ -362,8 +362,8 @@ class JedisInvoker { SingleInvocationSpec from(ConnectionFunction6 function, PipelineFunction6 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3, t4, t5, t6), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6)); @@ -377,7 +377,7 @@ class JedisInvoker { */ , E> ManyInvocationSpec fromMany(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(function, connection -> { throw new InvalidDataAccessApiUsageException("Operation not supported in pipelining/transaction mode"); @@ -394,8 +394,8 @@ class JedisInvoker { , E> ManyInvocationSpec fromMany(ConnectionFunction0 function, PipelineFunction0 pipelineFunction) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return new DefaultManyInvocationSpec<>((Function) function::apply, pipelineFunction::apply, synchronizer); } @@ -411,8 +411,8 @@ class JedisInvoker { , E, T1> ManyInvocationSpec fromMany(ConnectionFunction1 function, PipelineFunction1 pipelineFunction, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1)); } @@ -429,8 +429,8 @@ class JedisInvoker { , E, T1, T2> ManyInvocationSpec fromMany(ConnectionFunction2 function, PipelineFunction2 pipelineFunction, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2)); } @@ -448,8 +448,8 @@ class JedisInvoker { , E, T1, T2, T3> ManyInvocationSpec fromMany(ConnectionFunction3 function, PipelineFunction3 pipelineFunction, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3)); } @@ -469,8 +469,8 @@ class JedisInvoker { ConnectionFunction4 function, PipelineFunction4 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3, t4), it -> pipelineFunction.apply(it, t1, t2, t3, t4)); } @@ -491,8 +491,8 @@ class JedisInvoker { ConnectionFunction5 function, PipelineFunction5 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3, t4, t5), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5)); } @@ -514,8 +514,8 @@ class JedisInvoker { ConnectionFunction6 function, PipelineFunction6 pipelineFunction, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) { - Assert.notNull(function, "ConnectionFunction must not be null!"); - Assert.notNull(pipelineFunction, "PipelineFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); + Assert.notNull(pipelineFunction, "PipelineFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3, t4, t5, t6), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6)); @@ -947,7 +947,7 @@ class JedisInvoker { @Override public T getOrElse(Converter converter, Supplier nullDefault) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parentFunction, parentPipelineFunction, converter, nullDefault); } @@ -971,7 +971,7 @@ class JedisInvoker { @Override public List toList(Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parentFunction, parentPipelineFunction, source -> { @@ -992,7 +992,7 @@ class JedisInvoker { @Override public Set toSet(Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parentFunction, parentPipelineFunction, source -> { diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisKeyCommands.java index 1da8f99f6..d00489eea 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisKeyCommands.java @@ -61,7 +61,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean exists(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::exists, PipelineBinaryCommands::exists, key); } @@ -70,8 +70,8 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long exists(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(JedisBinaryCommands::exists, PipelineBinaryCommands::exists, keys); } @@ -79,16 +79,16 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long del(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(JedisBinaryCommands::del, PipelineBinaryCommands::del, keys); } public Boolean copy(byte[] sourceKey, byte[] targetKey, boolean replace) { - Assert.notNull(sourceKey, "source key must not be null!"); - Assert.notNull(targetKey, "target key must not be null!"); + Assert.notNull(sourceKey, "source key must not be null"); + Assert.notNull(targetKey, "target key must not be null"); return connection.invoke().just(JedisBinaryCommands::copy, PipelineBinaryCommands::copy, sourceKey, targetKey, replace); @@ -98,7 +98,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long unlink(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection.invoke().just(JedisBinaryCommands::unlink, PipelineBinaryCommands::unlink, keys); } @@ -106,7 +106,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public DataType type(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::type, PipelineBinaryCommands::type, key) .get(JedisConverters.stringToDataType()); @@ -116,7 +116,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long touch(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection.invoke().just(JedisBinaryCommands::touch, PipelineBinaryCommands::touch, keys); } @@ -124,7 +124,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Set keys(byte[] pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return connection.invoke().just(JedisBinaryCommands::keys, PipelineBinaryCommands::keys, pattern); } @@ -148,7 +148,7 @@ class JedisKeyCommands implements RedisKeyCommands { protected ScanIteration doScan(long cursorId, ScanOptions options) { if (isQueueing() || isPipelined()) { - throw new InvalidDataAccessApiUsageException("'SCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'SCAN' cannot be called in pipeline / transaction mode"); } ScanParams params = JedisConverters.toScanParams(options); @@ -187,8 +187,8 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public void rename(byte[] oldKey, byte[] newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New key must not be null"); connection.invokeStatus().just(JedisBinaryCommands::rename, PipelineBinaryCommands::rename, oldKey, newKey); } @@ -196,8 +196,8 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean renameNX(byte[] sourceKey, byte[] targetKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Target key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Target key must not be null"); return connection.invoke() .from(JedisBinaryCommands::renamenx, PipelineBinaryCommands::renamenx, sourceKey, targetKey) @@ -207,7 +207,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean expire(byte[] key, long seconds) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (seconds > Integer.MAX_VALUE) { return pExpire(key, TimeUnit.SECONDS.toMillis(seconds)); @@ -220,7 +220,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean pExpire(byte[] key, long millis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::pexpire, PipelineBinaryCommands::pexpire, key, millis) .get(JedisConverters.longToBoolean()); @@ -229,7 +229,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean expireAt(byte[] key, long unixTime) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::expireAt, PipelineBinaryCommands::expireAt, key, unixTime) .get(JedisConverters.longToBoolean()); @@ -238,7 +238,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean pExpireAt(byte[] key, long unixTimeInMillis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .from(JedisBinaryCommands::pexpireAt, PipelineBinaryCommands::pexpireAt, key, unixTimeInMillis) @@ -248,7 +248,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean persist(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::persist, PipelineBinaryCommands::persist, key) .get(JedisConverters.longToBoolean()); @@ -257,7 +257,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Boolean move(byte[] key, int dbIndex) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(j -> j.move(key, dbIndex)).get(JedisConverters.longToBoolean()); } @@ -265,7 +265,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long ttl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::ttl, PipelineBinaryCommands::ttl, key); } @@ -273,7 +273,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long ttl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::ttl, PipelineBinaryCommands::ttl, key) .get(Converters.secondsToTimeUnit(timeUnit)); @@ -282,7 +282,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::pttl, PipelineBinaryCommands::pttl, key); } @@ -290,7 +290,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::pttl, PipelineBinaryCommands::pttl, key) .get(Converters.millisecondsToTimeUnit(timeUnit)); @@ -299,7 +299,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public List sort(byte[] key, SortParameters params) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); SortingParams sortParams = JedisConverters.toSortingParams(params); @@ -313,7 +313,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long sort(byte[] key, @Nullable SortParameters params, byte[] storeKey) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); SortingParams sortParams = JedisConverters.toSortingParams(params); @@ -328,7 +328,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public byte[] dump(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::dump, PipelineBinaryCommands::dump, key); } @@ -336,8 +336,8 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(serializedValue, "Serialized value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(serializedValue, "Serialized value must not be null"); if (replace) { @@ -347,7 +347,7 @@ class JedisKeyCommands implements RedisKeyCommands { } if (ttlInMillis > Integer.MAX_VALUE) { - throw new IllegalArgumentException("TtlInMillis must be less than Integer.MAX_VALUE for restore in Jedis."); + throw new IllegalArgumentException("TtlInMillis must be less than Integer.MAX_VALUE for restore in Jedis"); } connection.invokeStatus().just(JedisBinaryCommands::restore, PipelineBinaryCommands::restore, key, @@ -358,7 +358,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public ValueEncoding encodingOf(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::objectEncoding, PipelineBinaryCommands::objectEncoding, key) .getOrElse(JedisConverters::toEncoding, () -> RedisValueEncoding.VACANT); @@ -368,7 +368,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Duration idletime(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(JedisBinaryCommands::objectIdletime, PipelineBinaryCommands::objectIdletime, key) .get(Converters::secondsToDuration); @@ -378,7 +378,7 @@ class JedisKeyCommands implements RedisKeyCommands { @Override public Long refcount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::objectRefcount, PipelineBinaryCommands::objectRefcount, key); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisListCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisListCommands.java index 70bf4d5b9..caf1feb61 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisListCommands.java @@ -44,7 +44,7 @@ class JedisListCommands implements RedisListCommands { @Override public Long rPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::rpush, PipelineBinaryCommands::rpush, key, values); } @@ -52,8 +52,8 @@ class JedisListCommands implements RedisListCommands { @Override public List lPos(byte[] key, byte[] element, @Nullable Integer rank, @Nullable Integer count) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(element, "Element must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(element, "Element must not be null"); LPosParams params = new LPosParams(); if (rank != null) { @@ -72,9 +72,9 @@ class JedisListCommands implements RedisListCommands { @Override public Long lPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(JedisBinaryCommands::lpush, PipelineBinaryCommands::lpush, key, values); } @@ -82,8 +82,8 @@ class JedisListCommands implements RedisListCommands { @Override public Long rPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(JedisBinaryCommands::rpushx, PipelineBinaryCommands::rpushx, key, value); } @@ -91,8 +91,8 @@ class JedisListCommands implements RedisListCommands { @Override public Long lPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(JedisBinaryCommands::lpushx, PipelineBinaryCommands::lpushx, key, value); } @@ -100,7 +100,7 @@ class JedisListCommands implements RedisListCommands { @Override public Long lLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::llen, PipelineBinaryCommands::llen, key); } @@ -108,7 +108,7 @@ class JedisListCommands implements RedisListCommands { @Override public List lRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::lrange, PipelineBinaryCommands::lrange, key, start, end); } @@ -116,7 +116,7 @@ class JedisListCommands implements RedisListCommands { @Override public void lTrim(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); connection.invokeStatus().just(JedisBinaryCommands::ltrim, PipelineBinaryCommands::ltrim, key, start, end); } @@ -124,7 +124,7 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] lIndex(byte[] key, long index) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::lindex, PipelineBinaryCommands::lindex, key, index); } @@ -132,7 +132,7 @@ class JedisListCommands implements RedisListCommands { @Override public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::linsert, PipelineBinaryCommands::linsert, key, JedisConverters.toListPosition(where), pivot, value); @@ -141,10 +141,10 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] lMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return connection.invoke().just(JedisBinaryCommands::lmove, PipelineBinaryCommands::lmove, sourceKey, destinationKey, ListDirection.valueOf(from.name()), ListDirection.valueOf(to.name())); @@ -153,10 +153,10 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] bLMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to, double timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return connection.invoke().just(JedisBinaryCommands::blmove, PipelineBinaryCommands::blmove, sourceKey, destinationKey, ListDirection.valueOf(from.name()), ListDirection.valueOf(to.name()), timeout); @@ -165,8 +165,8 @@ class JedisListCommands implements RedisListCommands { @Override public void lSet(byte[] key, long index, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); connection.invokeStatus().just(JedisBinaryCommands::lset, PipelineBinaryCommands::lset, key, index, value); } @@ -174,8 +174,8 @@ class JedisListCommands implements RedisListCommands { @Override public Long lRem(byte[] key, long count, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(JedisBinaryCommands::lrem, PipelineBinaryCommands::lrem, key, count, value); } @@ -183,7 +183,7 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] lPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::lpop, PipelineBinaryCommands::lpop, key); } @@ -191,7 +191,7 @@ class JedisListCommands implements RedisListCommands { @Override public List lPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::lpop, PipelineBinaryCommands::lpop, key, (int) count); } @@ -199,7 +199,7 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] rPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::rpop, PipelineBinaryCommands::rpop, key); } @@ -207,7 +207,7 @@ class JedisListCommands implements RedisListCommands { @Override public List rPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(JedisBinaryCommands::rpop, PipelineBinaryCommands::rpop, key, (int) count); } @@ -215,8 +215,8 @@ class JedisListCommands implements RedisListCommands { @Override public List bLPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(j -> j.blpop(timeout, keys), j -> j.blpop(timeout, keys)); } @@ -224,8 +224,8 @@ class JedisListCommands implements RedisListCommands { @Override public List bRPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(j -> j.brpop(timeout, keys), j -> j.brpop(timeout, keys)); } @@ -233,8 +233,8 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); return connection.invoke().just(JedisBinaryCommands::rpoplpush, PipelineBinaryCommands::rpoplpush, srcKey, dstKey); } @@ -242,8 +242,8 @@ class JedisListCommands implements RedisListCommands { @Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); return connection.invoke().just(JedisBinaryCommands::brpoplpush, PipelineBinaryCommands::brpoplpush, srcKey, dstKey, timeout); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisScriptingCommands.java index 4d1f8a6b6..5376c039e 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisScriptingCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisScriptingCommands.java @@ -55,7 +55,7 @@ class JedisScriptingCommands implements RedisScriptingCommands { @Override public String scriptLoad(byte[] script) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); assertDirectMode(); return connection.invoke().from(it -> it.scriptLoad(script)).get(JedisConverters::toString); @@ -64,8 +64,8 @@ class JedisScriptingCommands implements RedisScriptingCommands { @Override public List scriptExists(String... scriptSha1) { - Assert.notNull(scriptSha1, "Script digests must not be null!"); - Assert.noNullElements(scriptSha1, "Script digests must not contain null elements!"); + Assert.notNull(scriptSha1, "Script digests must not be null"); + Assert.noNullElements(scriptSha1, "Script digests must not contain null elements"); assertDirectMode(); return connection.invoke().just(it -> it.scriptExists(scriptSha1)); @@ -75,7 +75,7 @@ class JedisScriptingCommands implements RedisScriptingCommands { @SuppressWarnings("unchecked") public T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); assertDirectMode(); JedisScriptReturnConverter converter = new JedisScriptReturnConverter(returnType); @@ -92,7 +92,7 @@ class JedisScriptingCommands implements RedisScriptingCommands { @SuppressWarnings("unchecked") public T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(scriptSha, "Script digest must not be null!"); + Assert.notNull(scriptSha, "Script digest must not be null"); assertDirectMode(); JedisScriptReturnConverter converter = new JedisScriptReturnConverter(returnType); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisSentinelConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSentinelConnection.java index d6e0e7022..3043b9682 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisSentinelConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSentinelConnection.java @@ -45,7 +45,7 @@ public class JedisSentinelConnection implements RedisSentinelConnection { public JedisSentinelConnection(Jedis jedis) { - Assert.notNull(jedis, "Cannot created JedisSentinelConnection using 'null' as client."); + Assert.notNull(jedis, "Cannot created JedisSentinelConnection using 'null' as client"); this.jedis = jedis; init(); } @@ -53,8 +53,8 @@ public class JedisSentinelConnection implements RedisSentinelConnection { @Override public void failover(NamedNode master) { - Assert.notNull(master, "Redis node master must not be 'null' for failover."); - Assert.hasText(master.getName(), "Redis master name must not be 'null' or empty for failover."); + Assert.notNull(master, "Redis node master must not be 'null' for failover"); + Assert.hasText(master.getName(), "Redis master name must not be 'null' or empty for failover"); jedis.sentinelFailover(master.getName()); } @@ -66,7 +66,7 @@ public class JedisSentinelConnection implements RedisSentinelConnection { @Override public List replicas(NamedNode master) { - Assert.notNull(master, "Master node cannot be 'null' when loading replicas."); + Assert.notNull(master, "Master node cannot be 'null' when loading replicas"); return replicas(master.getName()); } @@ -77,14 +77,14 @@ public class JedisSentinelConnection implements RedisSentinelConnection { */ public List replicas(String masterName) { - Assert.hasText(masterName, "Name of redis master cannot be 'null' or empty when loading replicas."); + Assert.hasText(masterName, "Name of redis master cannot be 'null' or empty when loading replicas"); return JedisConverters.toListOfRedisServer(jedis.sentinelReplicas(masterName)); } @Override public void remove(NamedNode master) { - Assert.notNull(master, "Master node cannot be 'null' when trying to remove."); + Assert.notNull(master, "Master node cannot be 'null' when trying to remove"); remove(master.getName()); } @@ -94,18 +94,18 @@ public class JedisSentinelConnection implements RedisSentinelConnection { */ public void remove(String masterName) { - Assert.hasText(masterName, "Name of redis master cannot be 'null' or empty when trying to remove."); + Assert.hasText(masterName, "Name of redis master cannot be 'null' or empty when trying to remove"); jedis.sentinelRemove(masterName); } @Override public void monitor(RedisServer server) { - Assert.notNull(server, "Cannot monitor 'null' server."); - Assert.hasText(server.getName(), "Name of server to monitor must not be 'null' or empty."); - Assert.hasText(server.getHost(), "Host must not be 'null' for server to monitor."); - Assert.notNull(server.getPort(), "Port must not be 'null' for server to monitor."); - Assert.notNull(server.getQuorum(), "Quorum must not be 'null' for server to monitor."); + Assert.notNull(server, "Cannot monitor 'null' server"); + Assert.hasText(server.getName(), "Name of server to monitor must not be 'null' or empty"); + Assert.hasText(server.getHost(), "Host must not be 'null' for server to monitor"); + Assert.notNull(server.getPort(), "Port must not be 'null' for server to monitor"); + Assert.notNull(server.getQuorum(), "Quorum must not be 'null' for server to monitor"); jedis.sentinelMonitor(server.getName(), server.getHost(), server.getPort().intValue(), server.getQuorum().intValue()); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java index de0547b8f..09b634ba3 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java @@ -95,7 +95,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public Properties info(String section) { - Assert.notNull(section, "Section must not be null!"); + Assert.notNull(section, "Section must not be null"); return connection.invoke().from(j -> j.info(section)).get(JedisConverters::toProperties); } @@ -124,7 +124,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public Properties getConfig(String pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return connection.invoke().from(j -> j.configGet(pattern)).get(Converters::toProperties); } @@ -132,8 +132,8 @@ class JedisServerCommands implements RedisServerCommands { @Override public void setConfig(String param, String value) { - Assert.notNull(param, "Parameter must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(param, "Parameter must not be null"); + Assert.notNull(value, "Value must not be null"); connection.invokeStatus().just(j -> j.configSet(param, value)); } @@ -151,7 +151,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public Long time(TimeUnit timeUnit) { - Assert.notNull(timeUnit, "TimeUnit must not be null."); + Assert.notNull(timeUnit, "TimeUnit must not be null"); return connection.invoke().from(Jedis::time).get((List source) -> JedisConverters.toTime(source, timeUnit)); } @@ -159,7 +159,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public void killClient(String host, int port) { - Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'."); + Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'"); connection.invokeStatus().just(it -> it.clientKill(String.format("%s:%s", host, port))); } @@ -167,7 +167,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public void setClientName(byte[] name) { - Assert.notNull(name, "Name must not be null!"); + Assert.notNull(name, "Name must not be null"); connection.invokeStatus().just(it -> it.clientSetname(name)); } @@ -185,7 +185,7 @@ class JedisServerCommands implements RedisServerCommands { @Override public void replicaOf(String host, int port) { - Assert.hasText(host, "Host must not be null for 'REPLICAOF' command."); + Assert.hasText(host, "Host must not be null for 'REPLICAOF' command"); connection.invokeStatus().just(it -> it.replicaof(host, port)); } @@ -203,8 +203,8 @@ class JedisServerCommands implements RedisServerCommands { @Override public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(target, "Target node must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(target, "Target node must not be null"); int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE; diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSetCommands.java index 4d0452bca..19ced1c8a 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSetCommands.java @@ -48,9 +48,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sAdd(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(Jedis::sadd, PipelineBinaryCommands::sadd, key, values); } @@ -58,7 +58,7 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::scard, PipelineBinaryCommands::scard, key); } @@ -66,8 +66,8 @@ class JedisSetCommands implements RedisSetCommands { @Override public Set sDiff(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(Jedis::sdiff, PipelineBinaryCommands::sdiff, keys); } @@ -75,9 +75,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sDiffStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(Jedis::sdiffstore, PipelineBinaryCommands::sdiffstore, destKey, keys); } @@ -85,8 +85,8 @@ class JedisSetCommands implements RedisSetCommands { @Override public Set sInter(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(Jedis::sinter, PipelineBinaryCommands::sinter, keys); } @@ -94,9 +94,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sInterStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(Jedis::sinterstore, PipelineBinaryCommands::sinterstore, destKey, keys); } @@ -104,8 +104,8 @@ class JedisSetCommands implements RedisSetCommands { @Override public Boolean sIsMember(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::sismember, PipelineBinaryCommands::sismember, key, value); } @@ -113,9 +113,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public List sMIsMember(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(Jedis::smismember, PipelineBinaryCommands::smismember, key, values); } @@ -123,7 +123,7 @@ class JedisSetCommands implements RedisSetCommands { @Override public Set sMembers(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::smembers, PipelineBinaryCommands::smembers, key); } @@ -131,9 +131,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::smove, PipelineBinaryCommands::smove, srcKey, destKey, value) .get(JedisConverters::toBoolean); @@ -142,7 +142,7 @@ class JedisSetCommands implements RedisSetCommands { @Override public byte[] sPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::spop, PipelineBinaryCommands::spop, key); } @@ -150,7 +150,7 @@ class JedisSetCommands implements RedisSetCommands { @Override public List sPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::spop, PipelineBinaryCommands::spop, key, count).get(ArrayList::new); } @@ -158,7 +158,7 @@ class JedisSetCommands implements RedisSetCommands { @Override public byte[] sRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::srandmember, PipelineBinaryCommands::srandmember, key); } @@ -166,10 +166,10 @@ class JedisSetCommands implements RedisSetCommands { @Override public List sRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (count > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Count must be less than Integer.MAX_VALUE for sRandMember in Jedis."); + throw new IllegalArgumentException("Count must be less than Integer.MAX_VALUE for sRandMember in Jedis"); } return connection.invoke().just(Jedis::srandmember, PipelineBinaryCommands::srandmember, key, (int) count); @@ -178,9 +178,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(Jedis::srem, PipelineBinaryCommands::srem, key, values); } @@ -188,8 +188,8 @@ class JedisSetCommands implements RedisSetCommands { @Override public Set sUnion(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(Jedis::sunion, PipelineBinaryCommands::sunion, keys); } @@ -197,9 +197,9 @@ class JedisSetCommands implements RedisSetCommands { @Override public Long sUnionStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(Jedis::sunionstore, PipelineBinaryCommands::sunionstore, destKey, keys); } @@ -218,7 +218,7 @@ class JedisSetCommands implements RedisSetCommands { */ public Cursor sScan(byte[] key, long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor(key, cursorId, options) { @@ -226,7 +226,7 @@ class JedisSetCommands implements RedisSetCommands { protected ScanIteration doScan(byte[] key, long cursorId, ScanOptions options) { if (isQueueing() || isPipelined()) { - throw new InvalidDataAccessApiUsageException("'SSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'SSCAN' cannot be called in pipeline / transaction mode"); } ScanParams params = JedisConverters.toScanParams(options); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisStreamCommands.java index c08d63a53..3dcd5e8ca 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisStreamCommands.java @@ -63,9 +63,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Long xAck(byte[] key, String group, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(group, "Group name must not be null or empty!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(group, "Group name must not be null or empty"); + Assert.notNull(recordIds, "recordIds must not be null"); return connection.invoke().just(Jedis::xack, PipelineBinaryCommands::xack, key, JedisConverters.toBytes(group), StreamConverters.entryIdsToBytes(Arrays.asList(recordIds))); @@ -74,8 +74,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public RecordId xAdd(MapRecord record, XAddOptions options) { - Assert.notNull(record, "Record must not be null!"); - Assert.notNull(record.getStream(), "Stream must not be null!"); + Assert.notNull(record, "Record must not be null"); + Assert.notNull(record.getStream(), "Stream must not be null"); XAddParams params = StreamConverters.toXAddParams(record.getId(), options); @@ -87,9 +87,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public List xClaimJustId(byte[] key, String group, String newOwner, XClaimOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); - Assert.notNull(newOwner, "NewOwner must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); + Assert.notNull(newOwner, "NewOwner must not be null"); XClaimParams params = StreamConverters.toXClaimParams(options); @@ -103,9 +103,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public List xClaim(byte[] key, String group, String newOwner, XClaimOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); - Assert.notNull(newOwner, "NewOwner must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); + Assert.notNull(newOwner, "NewOwner must not be null"); XClaimParams params = StreamConverters.toXClaimParams(options); @@ -119,8 +119,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Long xDel(byte[] key, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "recordIds must not be null"); return connection.invoke().just(Jedis::xdel, PipelineBinaryCommands::xdel, key, StreamConverters.entryIdsToBytes(Arrays.asList(recordIds))); @@ -134,9 +134,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public String xGroupCreate(byte[] key, String groupName, ReadOffset readOffset, boolean mkStream) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); - Assert.notNull(readOffset, "ReadOffset must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); + Assert.notNull(readOffset, "ReadOffset must not be null"); return connection.invoke().just(Jedis::xgroupCreate, PipelineBinaryCommands::xgroupCreate, key, JedisConverters.toBytes(groupName), JedisConverters.toBytes(readOffset.getOffset()), mkStream); @@ -145,8 +145,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDelConsumer(byte[] key, Consumer consumer) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); return connection.invoke().from(Jedis::xgroupDelConsumer, PipelineBinaryCommands::xgroupDelConsumer, key, JedisConverters.toBytes(consumer.getGroup()), JedisConverters.toBytes(consumer.getName())).get(r -> r > 0); @@ -155,8 +155,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDestroy(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); return connection.invoke() .from(Jedis::xgroupDestroy, PipelineBinaryCommands::xgroupDestroy, key, JedisConverters.toBytes(groupName)) @@ -166,7 +166,7 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoStream xInfo(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::xinfoStream, ResponseCommands::xinfoStream, key).get(it -> { redis.clients.jedis.resps.StreamInfo streamInfo = BuilderFactory.STREAM_INFO.build(it); @@ -177,7 +177,7 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoGroups xInfoGroups(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::xinfoGroups, StreamPipelineBinaryCommands::xinfoGroups, key).get(it -> { List streamGroupInfos = BuilderFactory.STREAM_GROUP_INFO_LIST.build(it); @@ -191,8 +191,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public StreamInfo.XInfoConsumers xInfoConsumers(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); return connection.invoke() .from(Jedis::xinfoConsumers, ResponseCommands::xinfoConsumers, key, JedisConverters.toBytes(groupName)) @@ -208,7 +208,7 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Long xLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::xlen, PipelineBinaryCommands::xlen, key); } @@ -216,7 +216,7 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public PendingMessagesSummary xPending(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .from(Jedis::xpending, PipelineBinaryCommands::xpending, key, JedisConverters.toBytes(groupName)) @@ -226,8 +226,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public PendingMessages xPending(byte[] key, String groupName, XPendingOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); Range range = (Range) options.getRange(); XPendingParams xPendingParams = StreamConverters.toXPendingParams(options); @@ -241,9 +241,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public List xRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); int count = limit.isUnlimited() ? Integer.MAX_VALUE : limit.getCount(); @@ -257,8 +257,8 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public List xRead(StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadParams params = StreamConverters.toXReadParams(readOptions); @@ -271,9 +271,9 @@ class JedisStreamCommands implements RedisStreamCommands { public List xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadGroupParams params = StreamConverters.toXReadGroupParams(readOptions); @@ -286,9 +286,9 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public List xRevRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); int count = limit.isUnlimited() ? Integer.MAX_VALUE : limit.getCount(); return connection.invoke() @@ -306,7 +306,7 @@ class JedisStreamCommands implements RedisStreamCommands { @Override public Long xTrim(byte[] key, long count, boolean approximateTrimming) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::xtrim, PipelineBinaryCommands::xtrim, key, count, approximateTrimming); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisStringCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisStringCommands.java index 622645ff9..afd778be8 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisStringCommands.java @@ -48,7 +48,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public byte[] get(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::get, PipelineBinaryCommands::get, key); } @@ -57,7 +57,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public byte[] getDel(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::getDel, PipelineBinaryCommands::getDel, key); } @@ -66,8 +66,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public byte[] getEx(byte[] key, Expiration expiration) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); return connection.invoke().just(Jedis::getEx, PipelineBinaryCommands::getEx, key, JedisConverters.toGetExParams(expiration)); @@ -76,8 +76,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public byte[] getSet(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::getSet, PipelineBinaryCommands::getSet, key, value); } @@ -85,8 +85,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public List mGet(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(Jedis::mget, PipelineBinaryCommands::mget, keys); } @@ -94,8 +94,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::set, PipelineBinaryCommands::set, key, value) .get(Converters.stringToBooleanConverter()); @@ -104,10 +104,10 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value, Expiration expiration, SetOption option) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); - Assert.notNull(option, "Option must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); + Assert.notNull(option, "Option must not be null"); SetParams params = JedisConverters.toSetCommandExPxArgument(expiration, JedisConverters.toSetCommandNxXxArgument(option)); @@ -119,8 +119,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean setNX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::setnx, PipelineBinaryCommands::setnx, key, value) .get(Converters.longToBoolean()); @@ -129,11 +129,11 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean setEx(byte[] key, long seconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); if (seconds > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Time must be less than Integer.MAX_VALUE for setEx in Jedis."); + throw new IllegalArgumentException("Time must be less than Integer.MAX_VALUE for setEx in Jedis"); } return connection.invoke().from(Jedis::setex, PipelineBinaryCommands::setex, key, seconds, value) @@ -143,8 +143,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean pSetEx(byte[] key, long milliseconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(Jedis::psetex, PipelineBinaryCommands::psetex, key, milliseconds, value) .getOrElse(Converters.stringToBooleanConverter(), () -> false); @@ -153,7 +153,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean mSet(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().from(Jedis::mset, PipelineBinaryCommands::mset, JedisConverters.toByteArrays(tuples)) .get(Converters.stringToBooleanConverter()); @@ -162,7 +162,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean mSetNX(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().from(Jedis::msetnx, PipelineBinaryCommands::msetnx, JedisConverters.toByteArrays(tuples)) .get(Converters.longToBoolean()); @@ -171,7 +171,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long incr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::incr, PipelineBinaryCommands::incr, key); } @@ -179,7 +179,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long incrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::incrBy, PipelineBinaryCommands::incrBy, key, value); } @@ -187,7 +187,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Double incrBy(byte[] key, double value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::incrByFloat, PipelineBinaryCommands::incrByFloat, key, value); } @@ -195,7 +195,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long decr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::decr, PipelineBinaryCommands::decr, key); } @@ -203,7 +203,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long decrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::decrBy, PipelineBinaryCommands::decrBy, key, value); } @@ -211,8 +211,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long append(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::append, PipelineBinaryCommands::append, key, value); } @@ -220,7 +220,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public byte[] getRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::getrange, PipelineBinaryCommands::getrange, key, start, end); } @@ -228,8 +228,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public void setRange(byte[] key, byte[] value, long offset) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); connection.invokeStatus().just(Jedis::setrange, PipelineBinaryCommands::setrange, key, offset, value); } @@ -237,7 +237,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean getBit(byte[] key, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::getbit, PipelineBinaryCommands::getbit, key, offset); } @@ -245,7 +245,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Boolean setBit(byte[] key, long offset, boolean value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::setbit, PipelineBinaryCommands::setbit, key, offset, value); } @@ -253,7 +253,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::bitcount, PipelineBinaryCommands::bitcount, key); } @@ -261,7 +261,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::bitcount, PipelineBinaryCommands::bitcount, key, start, end); } @@ -269,8 +269,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public List bitField(byte[] key, BitFieldSubCommands subCommands) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(subCommands, "Command must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(subCommands, "Command must not be null"); return connection.invoke().just(Jedis::bitfield, PipelineBinaryCommands::bitfield, key, JedisConverters.toBitfieldCommandArguments(subCommands)); @@ -279,8 +279,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long bitOp(BitOperation op, byte[] destination, byte[]... keys) { - Assert.notNull(op, "BitOperation must not be null!"); - Assert.notNull(destination, "Destination key must not be null!"); + Assert.notNull(op, "BitOperation must not be null"); + Assert.notNull(destination, "Destination key must not be null"); if (op == BitOperation.NOT && keys.length > 1) { throw new IllegalArgumentException("Bitop NOT should only be performed against one key"); @@ -294,8 +294,8 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long bitPos(byte[] key, boolean bit, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null! Use Range.unbounded() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null Use Range.unbounded() instead"); if (range.getLowerBound().isBounded()) { @@ -312,7 +312,7 @@ class JedisStringCommands implements RedisStringCommands { @Override public Long strLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::strlen, PipelineBinaryCommands::strlen, key); } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java index 1ea87fbc6..51ecaea53 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java @@ -57,8 +57,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Boolean zAdd(byte[] key, double score, byte[] value, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke() .from(Jedis::zadd, PipelineBinaryCommands::zadd, key, score, value, JedisConverters.toZAddParams(args)) @@ -68,8 +68,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zAdd(byte[] key, Set tuples, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().just(Jedis::zadd, PipelineBinaryCommands::zadd, key, JedisConverters.toTupleMap(tuples), JedisConverters.toZAddParams(args)); @@ -78,9 +78,9 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(Jedis::zrem, PipelineBinaryCommands::zrem, key, values); } @@ -88,8 +88,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Double zIncrBy(byte[] key, double increment, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::zincrby, PipelineBinaryCommands::zincrby, key, increment, value); } @@ -97,7 +97,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public byte[] zRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::zrandmember, PipelineBinaryCommands::zrandmember, key); } @@ -105,7 +105,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public List zRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zrandmember, PipelineBinaryCommands::zrandmember, key, count).toList(); } @@ -113,7 +113,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Tuple zRandMemberWithScore(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .from(Jedis::zrandmemberWithScores, PipelineBinaryCommands::zrandmemberWithScores, key, 1L).get(it -> { @@ -129,7 +129,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public List zRandMemberWithScore(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .fromMany(Jedis::zrandmemberWithScores, PipelineBinaryCommands::zrandmemberWithScores, key, count) @@ -139,8 +139,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::zrank, PipelineBinaryCommands::zrank, key, value); } @@ -148,7 +148,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRevRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::zrevrank, PipelineBinaryCommands::zrevrank, key, value); } @@ -156,7 +156,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zrange, PipelineBinaryCommands::zrange, key, start, end).toSet(); } @@ -164,7 +164,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .fromMany(Jedis::zrangeWithScores, PipelineBinaryCommands::zrangeWithScores, key, start, end) @@ -175,9 +175,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYSCOREWITHSCORES must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYSCOREWITHSCORES must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -198,7 +198,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRevRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zrevrange, PipelineBinaryCommands::zrevrange, key, start, end).toSet(); } @@ -206,7 +206,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke() .fromMany(Jedis::zrevrangeWithScores, PipelineBinaryCommands::zrevrangeWithScores, key, start, end) @@ -217,9 +217,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRevRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYSCORE must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYSCORE must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -239,9 +239,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYSCOREWITHSCORES must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYSCOREWITHSCORES must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -262,7 +262,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zCount(byte[] key, double min, double max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::zcount, PipelineBinaryCommands::zcount, key, min, max); } @@ -270,8 +270,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -284,8 +284,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zLexCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -297,7 +297,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMin(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::zpopmin, PipelineBinaryCommands::zpopmin, key).get(JedisConverters::toTuple); } @@ -306,7 +306,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zPopMin(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zpopmin, PipelineBinaryCommands::zpopmin, key, Math.toIntExact(count)) .toSet(JedisConverters::toTuple); @@ -316,8 +316,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMin(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); return connection.invoke() .from(Jedis::bzpopmin, PipelineBinaryCommands::bzpopmin, JedisConverters.toSeconds(timeout, unit), key) @@ -328,7 +328,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMax(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(Jedis::zpopmax, PipelineBinaryCommands::zpopmax, key).get(JedisConverters::toTuple); } @@ -337,7 +337,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zPopMax(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zpopmax, PipelineBinaryCommands::zpopmax, key, Math.toIntExact(count)) .toSet(JedisConverters::toTuple); @@ -347,8 +347,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMax(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); return connection.invoke() .from(Jedis::bzpopmax, PipelineBinaryCommands::bzpopmax, JedisConverters.toSeconds(timeout, unit), key) @@ -358,7 +358,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::zcard, PipelineBinaryCommands::zcard, key); } @@ -366,8 +366,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Double zScore(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(Jedis::zscore, PipelineBinaryCommands::zscore, key, value); } @@ -375,8 +375,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public List zMScore(byte[] key, byte[][] values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Value must not be null"); return connection.invoke().just(Jedis::zmscore, PipelineBinaryCommands::zmscore, key, values); } @@ -384,7 +384,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRemRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(Jedis::zremrangeByRank, PipelineBinaryCommands::zremrangeByRank, key, start, end); } @@ -392,8 +392,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByLex(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -404,8 +404,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByScore(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREMRANGEBYSCORE must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREMRANGEBYSCORE must not be null"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -418,7 +418,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zDiff(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().just(Jedis::zdiff, PipelineBinaryCommands::zdiff, sets); } @@ -426,7 +426,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zDiffWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(Jedis::zdiffWithScores, PipelineBinaryCommands::zdiffWithScores, sets) .toSet(JedisConverters::toTuple); @@ -435,8 +435,8 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zDiffStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); return connection.invoke().just(Jedis::zdiffStore, PipelineBinaryCommands::zdiffStore, destKey, sets); } @@ -444,7 +444,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zInter(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().just(Jedis::zinter, PipelineBinaryCommands::zinter, new ZParams(), sets); } @@ -452,7 +452,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke() .fromMany(Jedis::zinterWithScores, PipelineBinaryCommands::zinterWithScores, new ZParams(), sets) @@ -462,10 +462,10 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); return connection.invoke().fromMany(Jedis::zinterWithScores, PipelineBinaryCommands::zinterWithScores, toZParams(aggregate, weights), sets).toSet(JedisConverters::toTuple); @@ -474,11 +474,11 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZParams zparams = toZParams(aggregate, weights); @@ -488,9 +488,9 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); return connection.invoke().just(Jedis::zinterstore, PipelineBinaryCommands::zinterstore, destKey, sets); } @@ -498,7 +498,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zUnion(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().just(Jedis::zunion, PipelineBinaryCommands::zunion, new ZParams(), sets); } @@ -506,7 +506,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke() .fromMany(Jedis::zunionWithScores, PipelineBinaryCommands::zunionWithScores, new ZParams(), sets) @@ -516,10 +516,10 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); return connection.invoke().fromMany(Jedis::zunionWithScores, PipelineBinaryCommands::zunionWithScores, toZParams(aggregate, weights), sets).toSet(JedisConverters::toTuple); @@ -528,12 +528,12 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.notNull(weights, "Weights must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.notNull(weights, "Weights must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZParams zparams = toZParams(aggregate, weights); @@ -543,9 +543,9 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); return connection.invoke().just(Jedis::zunionstore, PipelineBinaryCommands::zunionstore, destKey, sets); } @@ -564,7 +564,7 @@ class JedisZSetCommands implements RedisZSetCommands { */ public Cursor zScan(byte[] key, Long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor(key, cursorId, options) { @@ -572,7 +572,7 @@ class JedisZSetCommands implements RedisZSetCommands { protected ScanIteration doScan(byte[] key, long cursorId, ScanOptions options) { if (isQueueing() || isPipelined()) { - throw new InvalidDataAccessApiUsageException("'ZSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'ZSCAN' cannot be called in pipeline / transaction mode"); } ScanParams params = JedisConverters.toScanParams(options); @@ -594,7 +594,7 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(Jedis::zrangeByScore, PipelineBinaryCommands::zrangeByScore, key, JedisConverters.toBytes(min), JedisConverters.toBytes(max)).toSet(); @@ -603,12 +603,12 @@ class JedisZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { throw new IllegalArgumentException( - "Offset and count must be less than Integer.MAX_VALUE for zRangeByScore in Jedis."); + "Offset and count must be less than Integer.MAX_VALUE for zRangeByScore in Jedis"); } return connection.invoke().fromMany(Jedis::zrangeByScore, PipelineBinaryCommands::zrangeByScore, key, @@ -619,9 +619,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYSCORE must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYSCORE must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead"); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getLowerBound(), JedisConverters.NEGATIVE_INFINITY_BYTES); @@ -641,9 +641,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYLEX must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYLEX must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead"); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); @@ -660,9 +660,9 @@ class JedisZSetCommands implements RedisZSetCommands { public Set zRevRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYLEX must not be null!"); - Assert.notNull(limit, "Limit must not be null! Use Limit.unlimited() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYLEX must not be null"); + Assert.notNull(limit, "Limit must not be null Use Limit.unlimited() instead."); byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getLowerBound(), JedisConverters.MINUS_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getUpperBound(), JedisConverters.PLUS_BYTES); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/ClusterConnectionProvider.java b/src/main/java/org/springframework/data/redis/connection/lettuce/ClusterConnectionProvider.java index 1d4ee45b7..a75b7a9ed 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/ClusterConnectionProvider.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/ClusterConnectionProvider.java @@ -68,8 +68,8 @@ class ClusterConnectionProvider implements LettuceConnectionProvider, RedisClien */ ClusterConnectionProvider(RedisClusterClient client, RedisCodec codec, @Nullable ReadFrom readFrom) { - Assert.notNull(client, "Client must not be null!"); - Assert.notNull(codec, "Codec must not be null!"); + Assert.notNull(client, "Client must not be null"); + Assert.notNull(codec, "Codec must not be null"); this.client = client; this.codec = codec; @@ -111,7 +111,7 @@ class ClusterConnectionProvider implements LettuceConnectionProvider, RedisClien } return LettuceFutureUtils - .failed(new InvalidDataAccessApiUsageException("Connection type " + connectionType + " not supported!")); + .failed(new InvalidDataAccessApiUsageException("Connection type " + connectionType + " not supported")); } @Override diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceByteBufferPubSubListenerWrapper.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceByteBufferPubSubListenerWrapper.java index 77d387d06..c2e4a111e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceByteBufferPubSubListenerWrapper.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceByteBufferPubSubListenerWrapper.java @@ -35,7 +35,7 @@ class LettuceByteBufferPubSubListenerWrapper implements RedisPubSubListener delegate) { - Assert.notNull(delegate, "RedisPubSubListener must not be null!"); + Assert.notNull(delegate, "RedisPubSubListener must not be null"); this.delegate = delegate; } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java index 09b5fa38c..9a192b1fb 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java @@ -216,7 +216,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder clientResources(ClientResources clientResources) { - Assert.notNull(clientResources, "ClientResources must not be null!"); + Assert.notNull(clientResources, "ClientResources must not be null"); this.clientResources = clientResources; return this; @@ -231,7 +231,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder clientOptions(ClientOptions clientOptions) { - Assert.notNull(clientOptions, "ClientOptions must not be null!"); + Assert.notNull(clientOptions, "ClientOptions must not be null"); this.clientOptions = clientOptions; return this; @@ -247,7 +247,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder readFrom(ReadFrom readFrom) { - Assert.notNull(readFrom, "ReadFrom must not be null!"); + Assert.notNull(readFrom, "ReadFrom must not be null"); this.readFrom = readFrom; return this; @@ -263,7 +263,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder clientName(String clientName) { - Assert.hasText(clientName, "Client name must not be null or empty!"); + Assert.hasText(clientName, "Client name must not be null or empty"); this.clientName = clientName; return this; @@ -278,7 +278,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder commandTimeout(Duration timeout) { - Assert.notNull(timeout, "Duration must not be null!"); + Assert.notNull(timeout, "Duration must not be null"); this.timeout = timeout; return this; @@ -293,7 +293,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder shutdownTimeout(Duration shutdownTimeout) { - Assert.notNull(shutdownTimeout, "Duration must not be null!"); + Assert.notNull(shutdownTimeout, "Duration must not be null"); this.shutdownTimeout = shutdownTimeout; return this; @@ -309,7 +309,7 @@ public interface LettuceClientConfiguration { */ public LettuceClientConfigurationBuilder shutdownQuietPeriod(Duration shutdownQuietPeriod) { - Assert.notNull(shutdownQuietPeriod, "Duration must not be null!"); + Assert.notNull(shutdownQuietPeriod, "Duration must not be null"); this.shutdownQuietPeriod = shutdownQuietPeriod; return this; @@ -336,7 +336,7 @@ public interface LettuceClientConfiguration { LettuceSslClientConfigurationBuilder(LettuceClientConfigurationBuilder delegate) { - Assert.notNull(delegate, "Delegate client configuration builder must not be null!"); + Assert.notNull(delegate, "Delegate client configuration builder must not be null"); this.delegate = delegate; } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnection.java index 0323c9219..794915f11 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnection.java @@ -126,7 +126,7 @@ public class LettuceClusterConnection extends LettuceConnection super(null, connectionProvider, RedisURI.DEFAULT_TIMEOUT_DURATION.toMillis(), 0); Assert.isTrue(connectionProvider instanceof ClusterConnectionProvider, - "LettuceConnectionProvider must be a ClusterConnectionProvider."); + "LettuceConnectionProvider must be a ClusterConnectionProvider"); this.topologyProvider = new LettuceClusterTopologyProvider(getClient()); this.clusterCommandExecutor = new ClusterCommandExecutor(this.topologyProvider, @@ -160,9 +160,9 @@ public class LettuceClusterConnection extends LettuceConnection super(null, connectionProvider, timeout.toMillis(), 0); - Assert.notNull(executor, "ClusterCommandExecutor must not be null."); + Assert.notNull(executor, "ClusterCommandExecutor must not be null"); Assert.isTrue(connectionProvider instanceof ClusterConnectionProvider, - "LettuceConnectionProvider must be a ClusterConnectionProvider."); + "LettuceConnectionProvider must be a ClusterConnectionProvider"); this.topologyProvider = new LettuceClusterTopologyProvider(getClient()); this.clusterCommandExecutor = executor; @@ -186,7 +186,7 @@ public class LettuceClusterConnection extends LettuceConnection super(sharedConnection, connectionProvider, timeout.toMillis(), 0); - Assert.notNull(executor, "ClusterCommandExecutor must not be null."); + Assert.notNull(executor, "ClusterCommandExecutor must not be null"); this.topologyProvider = clusterTopologyProvider; this.clusterCommandExecutor = executor; @@ -204,7 +204,7 @@ public class LettuceClusterConnection extends LettuceConnection return (RedisClusterClient) ((RedisClientProvider) getConnectionProvider()).getRedisClient(); } - throw new IllegalStateException(String.format("Connection provider %s does not implement RedisClientProvider!", + throw new IllegalStateException(String.format("Connection provider %s does not implement RedisClientProvider", connectionProvider.getClass().getName())); } @@ -287,7 +287,7 @@ public class LettuceClusterConnection extends LettuceConnection @Override public Set clusterGetReplicas(RedisClusterNode master) { - Assert.notNull(master, "Master must not be null!"); + Assert.notNull(master, "Master must not be null"); RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(master); @@ -353,7 +353,7 @@ public class LettuceClusterConnection extends LettuceConnection @Override public void clusterAddSlots(RedisClusterNode node, SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); clusterAddSlots(node, range.getSlotsArray()); } @@ -377,7 +377,7 @@ public class LettuceClusterConnection extends LettuceConnection @Override public void clusterDeleteSlotsInRange(RedisClusterNode node, SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); clusterDeleteSlots(node, range.getSlotsArray()); } @@ -396,9 +396,9 @@ public class LettuceClusterConnection extends LettuceConnection @Override public void clusterMeet(RedisClusterNode node) { - Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command!"); - Assert.hasText(node.getHost(), "Node to meet cluster must have a host!"); - Assert.isTrue(node.getPort() > 0, "Node to meet cluster must have a port greater 0!"); + Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command"); + Assert.hasText(node.getHost(), "Node to meet cluster must have a host"); + Assert.isTrue(node.getPort() > 0, "Node to meet cluster must have a port greater 0"); this.clusterCommandExecutor.executeCommandOnAllNodes( (LettuceClusterCommandCallback) client -> client.clusterMeet(node.getHost(), node.getPort())); @@ -407,8 +407,8 @@ public class LettuceClusterConnection extends LettuceConnection @Override public void clusterSetSlot(RedisClusterNode node, int slot, AddSlots mode) { - Assert.notNull(node, "Node must not be null."); - Assert.notNull(mode, "AddSlots mode must not be null."); + Assert.notNull(node, "Node must not be null"); + Assert.notNull(mode, "AddSlots mode must not be null"); RedisClusterNode nodeToUse = topologyProvider.getTopology().lookup(node); String nodeId = nodeToUse.getId(); @@ -465,7 +465,7 @@ public class LettuceClusterConnection extends LettuceConnection public void select(int dbIndex) { if (dbIndex != 0) { - throw new InvalidDataAccessApiUsageException("Cannot SELECT non zero index in cluster mode."); + throw new InvalidDataAccessApiUsageException("Cannot SELECT non zero index in cluster mode"); } } @@ -473,17 +473,17 @@ public class LettuceClusterConnection extends LettuceConnection @Override public void watch(byte[]... keys) { - throw new InvalidDataAccessApiUsageException("WATCH is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("WATCH is currently not supported in cluster mode"); } @Override public void unwatch() { - throw new InvalidDataAccessApiUsageException("UNWATCH is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("UNWATCH is currently not supported in cluster mode"); } @Override public void multi() { - throw new InvalidDataAccessApiUsageException("MULTI is currently not supported in cluster mode."); + throw new InvalidDataAccessApiUsageException("MULTI is currently not supported in cluster mode"); } @@ -544,7 +544,7 @@ public class LettuceClusterConnection extends LettuceConnection @SuppressWarnings("unchecked") public RedisClusterCommands getResourceForSpecificNode(RedisClusterNode node) { - Assert.notNull(node, "Node must not be null!"); + Assert.notNull(node, "Node must not be null"); if (connection == null) { synchronized (this) { diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterHyperLogLogCommands.java index 80011f2f2..c76ab02aa 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterHyperLogLogCommands.java @@ -37,7 +37,7 @@ class LettuceClusterHyperLogLogCommands extends LettuceHyperLogLogCommands { return super.pfCount(keys); } - throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfcount in cluster mode."); + throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfcount in cluster mode"); } @Override @@ -50,6 +50,6 @@ class LettuceClusterHyperLogLogCommands extends LettuceHyperLogLogCommands { return; } - throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfmerge in cluster mode."); + throw new InvalidDataAccessApiUsageException("All keys must map to same slot for pfmerge in cluster mode"); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java index f34c266b9..899b04ce2 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java @@ -78,7 +78,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Override public Set keys(byte[] pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); Collection> keysPerNode = connection.getClusterCommandExecutor() .executeCommandOnAllNodes((LettuceClusterCommandCallback>) connection -> connection.keys(pattern)) @@ -95,8 +95,8 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Override public void rename(byte[] oldKey, byte[] newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(oldKey, newKey)) { super.rename(oldKey, newKey); @@ -115,8 +115,8 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Override public Boolean renameNX(byte[] sourceKey, byte[] targetKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Target key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Target key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(sourceKey, targetKey)) { return super.renameNX(sourceKey, targetKey); @@ -135,7 +135,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Override public Boolean move(byte[] key, int dbIndex) { - throw new InvalidDataAccessApiUsageException("MOVE not supported in CLUSTER mode!"); + throw new InvalidDataAccessApiUsageException("MOVE not supported in CLUSTER mode"); } @Nullable @@ -149,7 +149,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Nullable public Set keys(RedisClusterNode node, byte[] pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return LettuceConverters.toBytesSet(connection.getClusterCommandExecutor() .executeCommandOnSingleNode((LettuceClusterCommandCallback>) client -> client.keys(pattern), node) @@ -166,8 +166,8 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { */ Cursor scan(RedisClusterNode node, ScanOptions options) { - Assert.notNull(node, "RedisClusterNode must not be null!"); - Assert.notNull(options, "Options must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); + Assert.notNull(options, "Options must not be null"); return connection.getClusterCommandExecutor() .executeCommandOnSingleNode((LettuceClusterCommandCallback>) client -> { @@ -191,7 +191,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands { @Override public Long sort(byte[] key, SortParameters params, byte[] storeKey) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(key, storeKey)) { return super.sort(key, params, storeKey); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterListCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterListCommands.java index f157a887b..ce77c24e0 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterListCommands.java @@ -44,8 +44,8 @@ class LettuceClusterListCommands extends LettuceListCommands { @Override public List bLPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return super.bLPop(timeout, keys); @@ -67,8 +67,8 @@ class LettuceClusterListCommands extends LettuceListCommands { @Override public List bRPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return super.bRPop(timeout, keys); @@ -90,8 +90,8 @@ class LettuceClusterListCommands extends LettuceListCommands { @Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { return super.rPopLPush(srcKey, dstKey); @@ -105,8 +105,8 @@ class LettuceClusterListCommands extends LettuceListCommands { @Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { return super.bRPopLPush(timeout, srcKey, dstKey); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java index 9dfd7e43c..67b67c6dd 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java @@ -157,7 +157,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public Properties info(String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); Properties infos = new Properties(); List> nodeResults = executeCommandOnAllNodes( @@ -175,7 +175,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public Properties info(RedisClusterNode node, String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); return LettuceConverters.toProperties(executeCommandOnSingleNode(client -> client.info(section), node).getValue()); } @@ -192,7 +192,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public Properties getConfig(String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); List>> mapResult = executeCommandOnAllNodes(client -> client.configGet(pattern)) .getResults(); @@ -211,7 +211,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public Properties getConfig(RedisClusterNode node, String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); return executeCommandOnSingleNode(client -> Converters.toProperties(client.configGet(pattern)), node).getValue(); } @@ -219,8 +219,8 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void setConfig(String param, String value) { - Assert.hasText(param, "Parameter must not be null or empty!"); - Assert.hasText(value, "Value must not be null or empty!"); + Assert.hasText(param, "Parameter must not be null or empty"); + Assert.hasText(value, "Value must not be null or empty"); executeCommandOnAllNodes(client -> client.configSet(param, value)); } @@ -228,8 +228,8 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void setConfig(RedisClusterNode node, String param, String value) { - Assert.hasText(param, "Parameter must not be null or empty!"); - Assert.hasText(value, "Value must not be null or empty!"); + Assert.hasText(param, "Parameter must not be null or empty"); + Assert.hasText(value, "Value must not be null or empty"); executeCommandOnSingleNode(client -> client.configSet(param, value), node); } @@ -281,13 +281,13 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void replicaOf(String host, int port) { throw new InvalidDataAccessApiUsageException( - "REPLICAOF is not supported in cluster environment. Please use CLUSTER REPLICATE."); + "REPLICAOF is not supported in cluster environment; Please use CLUSTER REPLICATE."); } @Override public void replicaOfNoOne() { throw new InvalidDataAccessApiUsageException( - "REPLICAOF is not supported in cluster environment. Please use CLUSTER REPLICATE."); + "REPLICAOF is not supported in cluster environment; Please use CLUSTER REPLICATE."); } private NodeResult executeCommandOnSingleNode(LettuceClusterCommandCallback command, @@ -301,9 +301,9 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi private static Long convertListOfStringToTime(List serverTimeInformation, TimeUnit timeUnit) { - Assert.notEmpty(serverTimeInformation, "Received invalid result from server. Expected 2 items in collection."); + Assert.notEmpty(serverTimeInformation, "Received invalid result from server; Expected 2 items in collection."); Assert.isTrue(serverTimeInformation.size() == 2, - "Received invalid number of arguments from redis server. Expected 2 received " + serverTimeInformation.size()); + "Received invalid number of arguments from redis server; Expected 2 received " + serverTimeInformation.size()); return Converters.toTimeMillis(LettuceConverters.toString(serverTimeInformation.get(0)), LettuceConverters.toString(serverTimeInformation.get(1)), timeUnit); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterSetCommands.java index 2e593819f..c67f79eb4 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterSetCommands.java @@ -46,9 +46,9 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(value, "Value must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, destKey)) { return super.sMove(srcKey, destKey, value); @@ -65,8 +65,8 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Set sInter(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return super.sInter(keys); @@ -101,9 +101,9 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Long sInterStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); @@ -121,8 +121,8 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Set sUnion(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return super.sUnion(keys); @@ -148,9 +148,9 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Long sUnionStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); @@ -168,8 +168,8 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Set sDiff(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) { return super.sDiff(keys); @@ -198,9 +198,9 @@ class LettuceClusterSetCommands extends LettuceSetCommands { @Override public Long sDiffStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); byte[][] allKeys = ByteUtils.mergeArrays(destKey, keys); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterStringCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterStringCommands.java index 179072575..6c77aaf41 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterStringCommands.java @@ -34,7 +34,7 @@ class LettuceClusterStringCommands extends LettuceStringCommands { @Override public Boolean mSetNX(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(tuples.keySet().toArray(new byte[tuples.keySet().size()][]))) { return super.mSetNX(tuples); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterTopologyProvider.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterTopologyProvider.java index a36a0a2ea..ac3696f8e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterTopologyProvider.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterTopologyProvider.java @@ -39,7 +39,7 @@ class LettuceClusterTopologyProvider implements ClusterTopologyProvider { */ LettuceClusterTopologyProvider(RedisClusterClient client) { - Assert.notNull(client, "RedisClusterClient must not be null."); + Assert.notNull(client, "RedisClusterClient must not be null"); this.client = client; } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java index a85a3a878..0afb6d493 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java @@ -231,7 +231,7 @@ public class LettuceConnection extends AbstractRedisConnection { LettuceConnection(@Nullable StatefulConnection sharedConnection, LettuceConnectionProvider connectionProvider, long timeout, int defaultDbIndex) { - Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null."); + Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null"); this.asyncSharedConn = sharedConnection; this.connectionProvider = connectionProvider; @@ -556,8 +556,8 @@ public class LettuceConnection extends AbstractRedisConnection { public void select(int dbIndex) { if (asyncSharedConn != null) { - throw new InvalidDataAccessApiUsageException("Selecting a new database not supported due to shared connection. " - + "Use separate ConnectionFactorys to work with multiple databases"); + throw new InvalidDataAccessApiUsageException("Selecting a new database not supported due to shared connection;" + + " Use separate ConnectionFactorys to work with multiple databases"); } this.dbIndex = dbIndex; @@ -630,7 +630,7 @@ public class LettuceConnection extends AbstractRedisConnection { if (isQueueing() || isPipelined()) { throw new InvalidDataAccessApiUsageException( - "Transaction/Pipelining is not supported for Pub/Sub subscriptions!"); + "Transaction/Pipelining is not supported for Pub/Sub subscriptions"); } try { @@ -648,7 +648,7 @@ public class LettuceConnection extends AbstractRedisConnection { if (isQueueing() || isPipelined()) { throw new InvalidDataAccessApiUsageException( - "Transaction/Pipelining is not supported for Pub/Sub subscriptions!"); + "Transaction/Pipelining is not supported for Pub/Sub subscriptions"); } try { @@ -691,7 +691,7 @@ public class LettuceConnection extends AbstractRedisConnection { */ public void setPipeliningFlushPolicy(PipeliningFlushPolicy pipeliningFlushPolicy) { - Assert.notNull(pipeliningFlushPolicy, "PipeliningFlushingPolicy must not be null!"); + Assert.notNull(pipeliningFlushPolicy, "PipeliningFlushingPolicy must not be null"); this.pipeliningFlushPolicy = pipeliningFlushPolicy; } @@ -875,7 +875,7 @@ public class LettuceConnection extends AbstractRedisConnection { } throw new IllegalStateException( - String.format("%s is not a supported connection type.", connection.getClass().getName())); + String.format("%s is not a supported connection type", connection.getClass().getName())); } protected RedisClusterAsyncCommands getAsyncDedicatedConnection() { @@ -894,7 +894,7 @@ public class LettuceConnection extends AbstractRedisConnection { } throw new IllegalStateException( - String.format("%s is not a supported connection type.", connection.getClass().getName())); + String.format("%s is not a supported connection type", connection.getClass().getName())); } @SuppressWarnings("unchecked") @@ -1018,7 +1018,7 @@ public class LettuceConnection extends AbstractRedisConnection { try { redisCommand.validateArgumentCount(args != null ? args.length : 0); } catch (IllegalArgumentException e) { - throw new InvalidDataAccessApiUsageException(String.format("Validation failed for %s command.", cmd), e); + throw new InvalidDataAccessApiUsageException(String.format("Validation failed for %s command", cmd), e); } } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java index 9443a5a27..67c8df547 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java @@ -154,7 +154,7 @@ public class LettuceConnectionFactory */ private LettuceConnectionFactory(LettuceClientConfiguration clientConfig) { - Assert.notNull(clientConfig, "LettuceClientConfiguration must not be null!"); + Assert.notNull(clientConfig, "LettuceClientConfiguration must not be null"); this.clientConfiguration = clientConfig; this.configuration = this.standaloneConfig; @@ -211,7 +211,7 @@ public class LettuceConnectionFactory this(clientConfig); - Assert.notNull(standaloneConfig, "RedisStandaloneConfiguration must not be null!"); + Assert.notNull(standaloneConfig, "RedisStandaloneConfiguration must not be null"); this.standaloneConfig = standaloneConfig; this.configuration = this.standaloneConfig; @@ -229,7 +229,7 @@ public class LettuceConnectionFactory this(clientConfig); - Assert.notNull(redisConfiguration, "RedisConfiguration must not be null!"); + Assert.notNull(redisConfiguration, "RedisConfiguration must not be null"); this.configuration = redisConfiguration; } @@ -247,7 +247,7 @@ public class LettuceConnectionFactory this(clientConfig); - Assert.notNull(sentinelConfiguration, "RedisSentinelConfiguration must not be null!"); + Assert.notNull(sentinelConfiguration, "RedisSentinelConfiguration must not be null"); this.configuration = sentinelConfiguration; } @@ -265,7 +265,7 @@ public class LettuceConnectionFactory this(clientConfig); - Assert.notNull(clusterConfiguration, "RedisClusterConfiguration must not be null!"); + Assert.notNull(clusterConfiguration, "RedisClusterConfiguration must not be null"); this.configuration = clusterConfiguration; } @@ -406,7 +406,7 @@ public class LettuceConnectionFactory assertInitialized(); if (!isClusterAware()) { - throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); + throw new InvalidDataAccessApiUsageException("Cluster is not configured"); } RedisClusterClient clusterClient = (RedisClusterClient) client; @@ -485,7 +485,7 @@ public class LettuceConnectionFactory assertInitialized(); if (!isClusterAware()) { - throw new InvalidDataAccessApiUsageException("Cluster is not configured!"); + throw new InvalidDataAccessApiUsageException("Cluster is not configured"); } RedisClusterClient client = (RedisClusterClient) this.client; @@ -619,7 +619,7 @@ public class LettuceConnectionFactory */ public void setPipeliningFlushPolicy(PipeliningFlushPolicy pipeliningFlushPolicy) { - Assert.notNull(pipeliningFlushPolicy, "PipeliningFlushingPolicy must not be null!"); + Assert.notNull(pipeliningFlushPolicy, "PipeliningFlushingPolicy must not be null"); this.pipeliningFlushPolicy = pipeliningFlushPolicy; } @@ -861,7 +861,7 @@ public class LettuceConnectionFactory AbstractRedisClient client = getNativeClient(); - Assert.state(client != null, "Client not yet initialized. Did you forget to call initialize the bean?"); + Assert.state(client != null, "Client not yet initialized; Did you forget to call initialize the bean"); return client; } @@ -1371,7 +1371,7 @@ public class LettuceConnectionFactory if (!valid) { - log.info("Validation of shared connection failed. Creating a new connection."); + log.info("Validation of shared connection failed; Creating a new connection."); resetConnection(); this.connection = getNativeConnection(); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java index 1a9afb12d..4ef9e9808 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java @@ -630,9 +630,9 @@ public abstract class LettuceConverters extends Converters { return source -> { - Assert.notEmpty(source, "Received invalid result from server. Expected 2 items in collection."); + Assert.notEmpty(source, "Received invalid result from server; Expected 2 items in collection"); Assert.isTrue(source.size() == 2, - "Received invalid nr of arguments from redis server. Expected 2 received " + source.size()); + "Received invalid nr of arguments from redis server; Expected 2 received " + source.size()); return toTimeMillis(toString(source.get(0)), toString(source.get(1)), timeUnit); }; @@ -749,7 +749,7 @@ public abstract class LettuceConverters extends Converters { break; default: throw new IllegalArgumentException( - String.format("Invalid OVERFLOW. Expected one the following %s but got %s.", + String.format("Invalid OVERFLOW; Expected one the following %s but got %s", Arrays.toString(Overflow.values()), overflow)); } args = args.overflow(type); @@ -943,7 +943,7 @@ public abstract class LettuceConverters extends Converters { case SYNC: return FlushMode.SYNC; default: - throw new IllegalArgumentException("Flush option " + option + " is not supported."); + throw new IllegalArgumentException("Flush option " + option + " is not supported"); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceFutureUtils.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceFutureUtils.java index 784fe6253..cbfa470b3 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceFutureUtils.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceFutureUtils.java @@ -41,7 +41,7 @@ class LettuceFutureUtils { */ static CompletableFuture failed(Throwable throwable) { - Assert.notNull(throwable, "Throwable must not be null!"); + Assert.notNull(throwable, "Throwable must not be null"); CompletableFuture future = new CompletableFuture<>(); future.completeExceptionally(throwable); @@ -62,7 +62,7 @@ class LettuceFutureUtils { @Nullable static T join(CompletionStage future) throws RuntimeException, CompletionException { - Assert.notNull(future, "CompletableFuture must not be null!"); + Assert.notNull(future, "CompletableFuture must not be null"); try { return future.toCompletableFuture().join(); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceGeoCommands.java index f592befea..c1ced5969 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceGeoCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceGeoCommands.java @@ -55,9 +55,9 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Point point, byte[] member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(point, "Point must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(point, "Point must not be null"); + Assert.notNull(member, "Member must not be null"); return connection.invoke().just(RedisGeoAsyncCommands::geoadd, key, point.getX(), point.getY(), member); } @@ -65,8 +65,8 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Map memberCoordinateMap) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null"); List values = new ArrayList<>(); for (Entry entry : memberCoordinateMap.entrySet()) { @@ -82,8 +82,8 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public Long geoAdd(byte[] key, Iterable> locations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(locations, "Locations must not be null"); List values = new ArrayList<>(); for (GeoLocation location : locations) { @@ -109,10 +109,10 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member1 must not be null!"); - Assert.notNull(member2, "Member2 must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member1 must not be null"); + Assert.notNull(member2, "Member2 must not be null"); + Assert.notNull(metric, "Metric must not be null"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(metric); Converter distanceConverter = LettuceConverters.distanceConverterForMetric(metric); @@ -124,9 +124,9 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public List geoHash(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); return connection.invoke().fromMany(RedisGeoAsyncCommands::geohash, key, members) .toList(it -> it.getValueOrElse(null)); @@ -135,9 +135,9 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public List geoPos(byte[] key, byte[]... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(members, "Members must not be null!"); - Assert.noNullElements(members, "Members must not contain null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(members, "Members must not be null"); + Assert.noNullElements(members, "Members must not contain null"); return connection.invoke().fromMany(RedisGeoAsyncCommands::geopos, key, members) .toList(LettuceConverters::geoCoordinatesToPoint); @@ -146,8 +146,8 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); Converter, GeoResults>> geoResultsConverter = LettuceConverters .bytesSetToGeoResultsConverter(); @@ -161,9 +161,9 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Within must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Within must not be null"); + Assert.notNull(args, "Args must not be null"); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter>, GeoResults>> geoResultsConverter = LettuceConverters @@ -183,9 +183,9 @@ class LettuceGeoCommands implements RedisGeoCommands { @Override public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(radius.getMetric()); Converter, GeoResults>> converter = LettuceConverters @@ -199,10 +199,10 @@ class LettuceGeoCommands implements RedisGeoCommands { public GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(radius, "Radius must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(radius, "Radius must not be null"); + Assert.notNull(args, "Args must not be null"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(radius.getMetric()); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); @@ -223,10 +223,10 @@ class LettuceGeoCommands implements RedisGeoCommands { public GeoResults> geoSearch(byte[] key, GeoReference reference, GeoShape predicate, GeoSearchCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(reference, "Reference must not be null!"); - Assert.notNull(predicate, "GeoPredicate must not be null!"); - Assert.notNull(args, "GeoSearchCommandArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(predicate, "GeoPredicate must not be null"); + Assert.notNull(args, "GeoSearchCommandArgs must not be null"); GeoSearch.GeoRef ref = LettuceConverters.toGeoRef(reference); GeoSearch.GeoPredicate lettucePredicate = LettuceConverters.toGeoPredicate(predicate); @@ -240,10 +240,10 @@ class LettuceGeoCommands implements RedisGeoCommands { public Long geoSearchStore(byte[] destKey, byte[] key, GeoReference reference, GeoShape predicate, GeoSearchStoreCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(reference, "Reference must not be null!"); - Assert.notNull(predicate, "GeoPredicate must not be null!"); - Assert.notNull(args, "GeoSearchCommandArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(predicate, "GeoPredicate must not be null"); + Assert.notNull(args, "GeoSearchCommandArgs must not be null"); GeoSearch.GeoRef ref = LettuceConverters.toGeoRef(reference); GeoSearch.GeoPredicate lettucePredicate = LettuceConverters.toGeoPredicate(predicate); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHashCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHashCommands.java index 0053487ba..de686a987 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHashCommands.java @@ -51,9 +51,9 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hset, key, field, value); } @@ -61,9 +61,9 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Boolean hSetNX(byte[] key, byte[] field, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hsetnx, key, field, value); } @@ -71,8 +71,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Long hDel(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hdel, key, fields); } @@ -80,8 +80,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Boolean hExists(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Fields must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hexists, key, field); } @@ -89,8 +89,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public byte[] hGet(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hget, key, field); } @@ -98,7 +98,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Map hGetAll(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hgetall, key); } @@ -107,7 +107,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public byte[] hRandField(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hrandfield, key); } @@ -116,7 +116,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Entry hRandFieldWithValues(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisHashAsyncCommands::hrandfieldWithvalues, key) .get(LettuceHashCommands::toEntry); @@ -126,7 +126,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public List hRandField(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hrandfield, key, count); } @@ -135,7 +135,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public List> hRandFieldWithValues(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisHashAsyncCommands::hrandfieldWithvalues, key, count) .toList(LettuceHashCommands::toEntry); @@ -144,8 +144,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Long hIncrBy(byte[] key, byte[] field, long delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hincrby, key, field, delta); } @@ -153,8 +153,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Double hIncrBy(byte[] key, byte[] field, double delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hincrbyfloat, key, field, delta); } @@ -162,7 +162,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Set hKeys(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisHashAsyncCommands::hkeys, key).toSet(); } @@ -170,7 +170,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Long hLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hlen, key); } @@ -178,8 +178,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public List hMGet(byte[] key, byte[]... fields) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(fields, "Fields must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(fields, "Fields must not be null"); return connection.invoke().fromMany(RedisHashAsyncCommands::hmget, key, fields) .toList(source -> source.getValueOrElse(null)); @@ -188,8 +188,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public void hMSet(byte[] key, Map hashes) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashes, "Hashes must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashes, "Hashes must not be null"); connection.invokeStatus().just(RedisHashAsyncCommands::hmset, key, hashes); } @@ -197,7 +197,7 @@ class LettuceHashCommands implements RedisHashCommands { @Override public List hVals(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hvals, key); } @@ -216,7 +216,7 @@ class LettuceHashCommands implements RedisHashCommands { */ public Cursor> hScan(byte[] key, long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor>(key, cursorId, options) { @@ -224,7 +224,7 @@ class LettuceHashCommands implements RedisHashCommands { protected ScanIteration> doScan(byte[] key, long cursorId, ScanOptions options) { if (connection.isQueueing() || connection.isPipelined()) { - throw new InvalidDataAccessApiUsageException("'HSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'HSCAN' cannot be called in pipeline / transaction mode"); } io.lettuce.core.ScanCursor scanCursor = connection.getScanCursor(cursorId); @@ -250,8 +250,8 @@ class LettuceHashCommands implements RedisHashCommands { @Override public Long hStrLen(byte[] key, byte[] field) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(field, "Field must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(field, "Field must not be null"); return connection.invoke().just(RedisHashAsyncCommands::hstrlen, key, field); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHyperLogLogCommands.java index 74070f07c..540aeae1d 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceHyperLogLogCommands.java @@ -37,7 +37,7 @@ class LettuceHyperLogLogCommands implements RedisHyperLogLogCommands { public Long pfAdd(byte[] key, byte[]... values) { Assert.notEmpty(values, "PFADD requires at least one non 'null' value."); - Assert.noNullElements(values, "Values for PFADD must not contain 'null'."); + Assert.noNullElements(values, "Values for PFADD must not contain 'null'"); return connection.invoke().just(RedisHLLAsyncCommands::pfadd, key, values); } @@ -46,7 +46,7 @@ class LettuceHyperLogLogCommands implements RedisHyperLogLogCommands { public Long pfCount(byte[]... keys) { Assert.notEmpty(keys, "PFCOUNT requires at least one non 'null' key."); - Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'."); + Assert.noNullElements(keys, "Keys for PFCOUNT must not contain 'null'"); return connection.invoke().just(RedisHLLAsyncCommands::pfcount, keys); } @@ -56,7 +56,7 @@ class LettuceHyperLogLogCommands implements RedisHyperLogLogCommands { Assert.notNull(destinationKey, "Destination key must not be null"); Assert.notNull(sourceKeys, "Source keys must not be null"); - Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'."); + Assert.noNullElements(sourceKeys, "Keys for PFMERGE must not contain 'null'"); connection.invoke().just(RedisHLLAsyncCommands::pfmerge, destinationKey, sourceKeys); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceInvoker.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceInvoker.java index 7ca798ed0..e4dc58038 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceInvoker.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceInvoker.java @@ -75,7 +75,7 @@ class LettuceInvoker { @Nullable R just(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection), Converters.identityConverter(), () -> null); } @@ -89,7 +89,7 @@ class LettuceInvoker { @Nullable R just(ConnectionFunction1 function, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection, t1)); } @@ -104,7 +104,7 @@ class LettuceInvoker { @Nullable R just(ConnectionFunction2 function, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection, t1, t2)); } @@ -120,7 +120,7 @@ class LettuceInvoker { @Nullable R just(ConnectionFunction3 function, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection, t1, t2, t3)); } @@ -137,7 +137,7 @@ class LettuceInvoker { @Nullable R just(ConnectionFunction4 function, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection, t1, t2, t3, t4)); } @@ -156,7 +156,7 @@ class LettuceInvoker { R just(ConnectionFunction5 function, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return synchronizer.invoke(() -> function.apply(connection, t1, t2, t3, t4, t5)); } @@ -169,7 +169,7 @@ class LettuceInvoker { */ SingleInvocationSpec from(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return new DefaultSingleInvocationSpec<>(() -> function.apply(connection), synchronizer); } @@ -183,7 +183,7 @@ class LettuceInvoker { */ SingleInvocationSpec from(ConnectionFunction1 function, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(it -> function.apply(it, t1)); } @@ -198,7 +198,7 @@ class LettuceInvoker { */ SingleInvocationSpec from(ConnectionFunction2 function, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(it -> function.apply(it, t1, t2)); } @@ -214,7 +214,7 @@ class LettuceInvoker { */ SingleInvocationSpec from(ConnectionFunction3 function, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3)); } @@ -232,7 +232,7 @@ class LettuceInvoker { SingleInvocationSpec from(ConnectionFunction4 function, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3, t4)); } @@ -251,7 +251,7 @@ class LettuceInvoker { SingleInvocationSpec from(ConnectionFunction5 function, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return from(it -> function.apply(it, t1, t2, t3, t4, t5)); } @@ -264,7 +264,7 @@ class LettuceInvoker { */ , E> ManyInvocationSpec fromMany(ConnectionFunction0 function) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return new DefaultManyInvocationSpec<>(() -> function.apply(connection), synchronizer); } @@ -278,7 +278,7 @@ class LettuceInvoker { */ , E, T1> ManyInvocationSpec fromMany(ConnectionFunction1 function, T1 t1) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(it -> function.apply(it, t1)); } @@ -294,7 +294,7 @@ class LettuceInvoker { , E, T1, T2> ManyInvocationSpec fromMany(ConnectionFunction2 function, T1 t1, T2 t2) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2)); } @@ -311,7 +311,7 @@ class LettuceInvoker { , E, T1, T2, T3> ManyInvocationSpec fromMany(ConnectionFunction3 function, T1 t1, T2 t2, T3 t3) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3)); } @@ -329,7 +329,7 @@ class LettuceInvoker { , E, T1, T2, T3, T4> ManyInvocationSpec fromMany( ConnectionFunction4 function, T1 t1, T2 t2, T3 t3, T4 t4) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3, t4)); } @@ -348,7 +348,7 @@ class LettuceInvoker { , E, T1, T2, T3, T4, T5> ManyInvocationSpec fromMany( ConnectionFunction5 function, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { - Assert.notNull(function, "ConnectionFunction must not be null!"); + Assert.notNull(function, "ConnectionFunction must not be null"); return fromMany(it -> function.apply(it, t1, t2, t3, t4, t5)); } @@ -593,7 +593,7 @@ class LettuceInvoker { @Override public T getOrElse(Converter converter, Supplier nullDefault) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parent, converter, nullDefault); } @@ -613,7 +613,7 @@ class LettuceInvoker { @Override public List toList(Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parent, source -> { @@ -634,7 +634,7 @@ class LettuceInvoker { @Override public Set toSet(Converter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); return synchronizer.invoke(parent, source -> { diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java index 22942e1de..bc85d7e3b 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceKeyCommands.java @@ -57,8 +57,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean copy(byte[] sourceKey, byte[] targetKey, boolean replace) { - Assert.notNull(sourceKey, "source key must not be null!"); - Assert.notNull(targetKey, "target key must not be null!"); + Assert.notNull(sourceKey, "source key must not be null"); + Assert.notNull(targetKey, "target key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::copy, sourceKey, targetKey, CopyArgs.Builder.replace(replace)); @@ -67,7 +67,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean exists(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::exists, key).get(LettuceConverters.longToBooleanConverter()); } @@ -76,8 +76,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long exists(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(RedisKeyAsyncCommands::exists, keys); } @@ -85,8 +85,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long del(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(RedisKeyAsyncCommands::del, keys); } @@ -95,7 +95,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long unlink(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::unlink, keys); } @@ -103,7 +103,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public DataType type(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::type, key).get(LettuceConverters.stringToDataType()); } @@ -111,7 +111,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long touch(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::touch, keys); } @@ -119,7 +119,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Set keys(byte[] pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return connection.invoke().fromMany(RedisKeyAsyncCommands::keys, pattern).toSet(); } @@ -150,7 +150,7 @@ class LettuceKeyCommands implements RedisKeyCommands { protected LettuceScanIteration doScan(ScanCursor cursor, ScanOptions options) { if (connection.isQueueing() || connection.isPipelined()) { - throw new InvalidDataAccessApiUsageException("'SCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'SCAN' cannot be called in pipeline / transaction mode"); } ScanArgs scanArgs = LettuceConverters.toScanArgs(options); @@ -176,8 +176,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public void rename(byte[] oldKey, byte[] newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New key must not be null"); connection.invokeStatus().just(RedisKeyAsyncCommands::rename, oldKey, newKey); } @@ -185,8 +185,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean renameNX(byte[] sourceKey, byte[] targetKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Target key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Target key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::renamenx, sourceKey, targetKey); } @@ -194,7 +194,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean expire(byte[] key, long seconds) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::expire, key, seconds); } @@ -202,7 +202,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean pExpire(byte[] key, long millis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::pexpire, key, millis); } @@ -210,7 +210,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean expireAt(byte[] key, long unixTime) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::expireat, key, unixTime); } @@ -218,7 +218,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean pExpireAt(byte[] key, long unixTimeInMillis) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::pexpireat, key, unixTimeInMillis); } @@ -226,7 +226,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean persist(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::persist, key); } @@ -234,7 +234,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Boolean move(byte[] key, int dbIndex) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::move, key, dbIndex); } @@ -242,7 +242,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long ttl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::ttl, key); } @@ -250,7 +250,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long ttl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::ttl, key).get(Converters.secondsToTimeUnit(timeUnit)); } @@ -258,7 +258,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::pttl, key); } @@ -266,7 +266,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long pTtl(byte[] key, TimeUnit timeUnit) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::pttl, key).get(Converters.millisecondsToTimeUnit(timeUnit)); } @@ -274,7 +274,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public List sort(byte[] key, SortParameters params) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); SortArgs args = LettuceConverters.toSortArgs(params); @@ -284,7 +284,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long sort(byte[] key, SortParameters params, byte[] sortKey) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); SortArgs args = LettuceConverters.toSortArgs(params); @@ -294,7 +294,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public byte[] dump(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::dump, key); } @@ -302,8 +302,8 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(serializedValue, "Serialized value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(serializedValue, "Serialized value must not be null"); RestoreArgs restoreArgs = RestoreArgs.Builder.ttl(ttlInMillis).replace(replace); @@ -314,7 +314,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public ValueEncoding encodingOf(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::objectEncoding, key).orElse(ValueEncoding::of, RedisValueEncoding.VACANT); @@ -324,7 +324,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Duration idletime(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisKeyAsyncCommands::objectIdletime, key).get(Converters::secondsToDuration); } @@ -333,7 +333,7 @@ class LettuceKeyCommands implements RedisKeyCommands { @Override public Long refcount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisKeyAsyncCommands::objectRefcount, key); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java index 7e3916bbf..5594c37f9 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceListCommands.java @@ -44,7 +44,7 @@ class LettuceListCommands implements RedisListCommands { @Override public Long rPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::rpush, key, values); } @@ -52,8 +52,8 @@ class LettuceListCommands implements RedisListCommands { @Override public List lPos(byte[] key, byte[] element, @Nullable Integer rank, @Nullable Integer count) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(element, "Element must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(element, "Element must not be null"); LPosArgs args = new LPosArgs(); if (rank != null) { @@ -71,9 +71,9 @@ class LettuceListCommands implements RedisListCommands { @Override public Long lPush(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(RedisListAsyncCommands::lpush, key, values); } @@ -81,8 +81,8 @@ class LettuceListCommands implements RedisListCommands { @Override public Long rPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisListAsyncCommands::rpushx, key, value); } @@ -90,8 +90,8 @@ class LettuceListCommands implements RedisListCommands { @Override public Long lPushX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisListAsyncCommands::lpushx, key, value); } @@ -99,7 +99,7 @@ class LettuceListCommands implements RedisListCommands { @Override public Long lLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::llen, key); } @@ -107,7 +107,7 @@ class LettuceListCommands implements RedisListCommands { @Override public List lRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::lrange, key, start, end); } @@ -115,7 +115,7 @@ class LettuceListCommands implements RedisListCommands { @Override public void lTrim(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); connection.invokeStatus().just(RedisListAsyncCommands::ltrim, key, start, end); } @@ -123,7 +123,7 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] lIndex(byte[] key, long index) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::lindex, key, index); } @@ -131,7 +131,7 @@ class LettuceListCommands implements RedisListCommands { @Override public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::linsert, key, LettuceConverters.toBoolean(where), pivot, value); @@ -140,10 +140,10 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] lMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return connection.invoke().just(RedisListAsyncCommands::lmove, sourceKey, destinationKey, LettuceConverters.toLmoveArgs(from, to)); @@ -153,10 +153,10 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] bLMove(byte[] sourceKey, byte[] destinationKey, Direction from, Direction to, double timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return connection.invoke(connection.getAsyncDedicatedConnection()).just(RedisListAsyncCommands::blmove, sourceKey, destinationKey, LettuceConverters.toLmoveArgs(from, to), timeout); @@ -165,8 +165,8 @@ class LettuceListCommands implements RedisListCommands { @Override public void lSet(byte[] key, long index, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); connection.invokeStatus().just(RedisListAsyncCommands::lset, key, index, value); } @@ -174,8 +174,8 @@ class LettuceListCommands implements RedisListCommands { @Override public Long lRem(byte[] key, long count, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisListAsyncCommands::lrem, key, count, value); } @@ -183,7 +183,7 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] lPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::lpop, key); } @@ -191,7 +191,7 @@ class LettuceListCommands implements RedisListCommands { @Override public List lPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::lpop, key, count); } @@ -199,7 +199,7 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] rPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::rpop, key); } @@ -207,7 +207,7 @@ class LettuceListCommands implements RedisListCommands { @Override public List rPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisListAsyncCommands::rpop, key, count); } @@ -215,8 +215,8 @@ class LettuceListCommands implements RedisListCommands { @Override public List bLPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke(connection.getAsyncDedicatedConnection()) .from(RedisListAsyncCommands::blpop, timeout, keys).get(LettuceListCommands::toBytesList); @@ -225,8 +225,8 @@ class LettuceListCommands implements RedisListCommands { @Override public List bRPop(int timeout, byte[]... keys) { - Assert.notNull(keys, "Key must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Key must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke(connection.getAsyncDedicatedConnection()) .from(RedisListAsyncCommands::brpop, timeout, keys).get(LettuceListCommands::toBytesList); @@ -235,8 +235,8 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); return connection.invoke().just(RedisListAsyncCommands::rpoplpush, srcKey, dstKey); } @@ -244,8 +244,8 @@ class LettuceListCommands implements RedisListCommands { @Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(dstKey, "Destination key must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(dstKey, "Destination key must not be null"); return connection.invoke(connection.getAsyncDedicatedConnection()).just(RedisListAsyncCommands::brpoplpush, timeout, srcKey, dstKey); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceMessageListener.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceMessageListener.java index 2f0f2b822..ee873f847 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceMessageListener.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceMessageListener.java @@ -35,8 +35,8 @@ class LettuceMessageListener implements RedisPubSubListener { LettuceMessageListener(MessageListener listener, SubscriptionListener subscriptionListener) { - Assert.notNull(listener, "MessageListener must not be null!"); - Assert.notNull(subscriptionListener, "SubscriptionListener must not be null!"); + Assert.notNull(listener, "MessageListener must not be null"); + Assert.notNull(subscriptionListener, "SubscriptionListener must not be null"); this.listener = listener; this.subscriptionListener = subscriptionListener; diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingClientConfiguration.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingClientConfiguration.java index 96d4a65c5..3b27d8a3f 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingClientConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingClientConfiguration.java @@ -158,7 +158,7 @@ public interface LettucePoolingClientConfiguration extends LettuceClientConfigur */ public LettucePoolingClientConfigurationBuilder poolConfig(GenericObjectPoolConfig poolConfig) { - Assert.notNull(poolConfig, "PoolConfig must not be null!"); + Assert.notNull(poolConfig, "PoolConfig must not be null"); this.poolConfig = poolConfig; return this; diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingConnectionProvider.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingConnectionProvider.java index e9576f53b..6852df0d7 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingConnectionProvider.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettucePoolingConnectionProvider.java @@ -78,8 +78,8 @@ class LettucePoolingConnectionProvider implements LettuceConnectionProvider, Red LettucePoolingConnectionProvider(LettuceConnectionProvider connectionProvider, LettucePoolingClientConfiguration clientConfiguration) { - Assert.notNull(connectionProvider, "ConnectionProvider must not be null!"); - Assert.notNull(clientConfiguration, "ClientConfiguration must not be null!"); + Assert.notNull(connectionProvider, "ConnectionProvider must not be null"); + Assert.notNull(clientConfiguration, "ClientConfiguration must not be null"); this.connectionProvider = connectionProvider; this.poolConfig = clientConfiguration.getPoolConfig(); @@ -137,7 +137,7 @@ class LettucePoolingConnectionProvider implements LettuceConnectionProvider, Red } throw new IllegalStateException( - String.format("Underlying connection provider %s does not implement RedisClientProvider!", + String.format("Underlying connection provider %s does not implement RedisClientProvider", connectionProvider.getClass().getName())); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterHyperLogLogCommands.java index 69454779f..5caee4858 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterHyperLogLogCommands.java @@ -53,7 +53,7 @@ class LettuceReactiveClusterHyperLogLogCommands extends LettuceReactiveHyperLogL return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null for PFMERGE"); - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty for PFMERGE!"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty for PFMERGE"); List keys = new ArrayList<>(command.getSourceKeys()); keys.add(command.getKey()); @@ -63,7 +63,7 @@ class LettuceReactiveClusterHyperLogLogCommands extends LettuceReactiveHyperLogL } return Mono - .error(new InvalidDataAccessApiUsageException("All keys must map to same slot for PFMERGE in cluster mode.")); + .error(new InvalidDataAccessApiUsageException("All keys must map to same slot for PFMERGE in cluster mode")); })); } @@ -72,7 +72,7 @@ class LettuceReactiveClusterHyperLogLogCommands extends LettuceReactiveHyperLogL return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notEmpty(command.getKeys(), "Keys must be null or empty for PFCOUNT!"); + Assert.notEmpty(command.getKeys(), "Keys must be null or empty for PFCOUNT"); if (ClusterSlotHashUtil .isSameSlotForAllKeys(command.getKeys().toArray(new ByteBuffer[command.getKeys().size()]))) { @@ -80,7 +80,7 @@ class LettuceReactiveClusterHyperLogLogCommands extends LettuceReactiveHyperLogL } return Mono - .error(new InvalidDataAccessApiUsageException("All keys must map to same slot for PFCOUNT in cluster mode.")); + .error(new InvalidDataAccessApiUsageException("All keys must map to same slot for PFCOUNT in cluster mode")); })); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterKeyCommands.java index afb463b27..c9709c00f 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterKeyCommands.java @@ -59,7 +59,7 @@ class LettuceReactiveClusterKeyCommands extends LettuceReactiveKeyCommands imple return connection.execute(node, cmd -> { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return cmd.keys(pattern).collectList(); }).next(); @@ -76,8 +76,8 @@ class LettuceReactiveClusterKeyCommands extends LettuceReactiveKeyCommands imple return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Old key must not be null."); - Assert.notNull(command.getNewKey(), "New key must not be null!"); + Assert.notNull(command.getKey(), "Old key must not be null"); + Assert.notNull(command.getNewKey(), "New key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKey(), command.getNewKey())) { return super.rename(Mono.just(command)); @@ -98,8 +98,8 @@ class LettuceReactiveClusterKeyCommands extends LettuceReactiveKeyCommands imple return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null."); - Assert.notNull(command.getNewKey(), "NewName must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getNewKey(), "NewName must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKey(), command.getNewKey())) { return super.renameNX(Mono.just(command)); @@ -124,6 +124,6 @@ class LettuceReactiveClusterKeyCommands extends LettuceReactiveKeyCommands imple @Override public Flux> move(Publisher commands) { - throw new InvalidDataAccessApiUsageException("MOVE not supported in CLUSTER mode!"); + throw new InvalidDataAccessApiUsageException("MOVE not supported in CLUSTER mode"); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterListCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterListCommands.java index 97938811b..1a3c38bff 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterListCommands.java @@ -48,8 +48,8 @@ class LettuceReactiveClusterListCommands extends LettuceReactiveListCommands imp return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); - Assert.notNull(command.getDirection(), "Direction must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); + Assert.notNull(command.getDirection(), "Direction must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKeys())) { return super.bPop(Mono.just(command)); @@ -64,8 +64,8 @@ class LettuceReactiveClusterListCommands extends LettuceReactiveListCommands imp return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDestination(), "Destination key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDestination(), "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKey(), command.getDestination())) { return super.rPopLPush(Mono.just(command)); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java index 682dfaf30..d05c6e424 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java @@ -138,7 +138,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono info(String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); return Flux.merge(executeOnAllNodes(redisClusterNode -> info(redisClusterNode, section))) .collect(PropertiesCollector.INSTANCE); @@ -147,7 +147,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono info(RedisClusterNode node, String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); return connection.execute(node, c -> c.info(section)) // .map(LettuceConverters::toProperties).next(); @@ -156,7 +156,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono getConfig(String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); return Flux.merge(executeOnAllNodes(node -> getConfig(node, pattern))) // .collect(PropertiesCollector.INSTANCE); @@ -165,7 +165,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono getConfig(RedisClusterNode node, String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); return connection.execute(node, c -> c.configGet(pattern)) // .map(LettuceConverters::toProperties) // @@ -180,8 +180,8 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono setConfig(RedisClusterNode node, String param, String value) { - Assert.hasText(param, "Parameter must not be null or empty!"); - Assert.hasText(value, "Value must not be null or empty!"); + Assert.hasText(param, "Parameter must not be null or empty"); + Assert.hasText(value, "Value must not be null or empty"); return connection.execute(node, c -> c.configSet(param, value)).next(); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterSetCommands.java index 1354a55bc..762c24610 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterSetCommands.java @@ -52,7 +52,7 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKeys())) { return super.sUnion(Mono.just(command)); @@ -70,8 +70,8 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Source keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Source keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); List keys = new ArrayList<>(command.getKeys()); keys.add(command.getKey()); @@ -98,7 +98,7 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKeys())) { return super.sInter(Mono.just(command)); @@ -130,8 +130,8 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Source keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Source keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); List keys = new ArrayList<>(command.getKeys()); keys.add(command.getKey()); @@ -158,7 +158,7 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKeys())) { return super.sDiff(Mono.just(command)); @@ -192,8 +192,8 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Source keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Source keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); List keys = new ArrayList<>(command.getKeys()); keys.add(command.getKey()); @@ -220,8 +220,8 @@ class LettuceReactiveClusterSetCommands extends LettuceReactiveSetCommands imple return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Source key must not be null!"); - Assert.notNull(command.getDestination(), "Destination key must not be null!"); + Assert.notNull(command.getKey(), "Source key must not be null"); + Assert.notNull(command.getDestination(), "Destination key must not be null"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getKey(), command.getDestination())) { return super.sMove(Mono.just(command)); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterZSetCommands.java index 66bcf6a02..267ab7b85 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterZSetCommands.java @@ -47,7 +47,7 @@ class LettuceReactiveClusterZSetCommands extends LettuceReactiveZSetCommands imp return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty."); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getSourceKeys())) { return super.zUnionStore(Mono.just(command)); @@ -63,7 +63,7 @@ class LettuceReactiveClusterZSetCommands extends LettuceReactiveZSetCommands imp Publisher commands) { return getConnection().execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty."); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(command.getSourceKeys())) { return super.zInterStore(Mono.just(command)); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveGeoCommands.java index b7a5a0b4b..584c45bf4 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveGeoCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveGeoCommands.java @@ -58,7 +58,7 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { */ LettuceReactiveGeoCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -67,14 +67,14 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getGeoLocations(), "Locations must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getGeoLocations(), "Locations must not be null"); List values = new ArrayList<>(); for (GeoLocation location : command.getGeoLocations()) { - Assert.notNull(location.getName(), "Location.Name must not be null!"); - Assert.notNull(location.getPoint(), "Location.Point must not be null!"); + Assert.notNull(location.getName(), "Location.Name must not be null"); + Assert.notNull(location.getPoint(), "Location.Point must not be null"); values.add(location.getPoint().getX()); values.add(location.getPoint().getY()); @@ -90,9 +90,9 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getFrom(), "From member must not be null!"); - Assert.notNull(command.getTo(), "To member must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getFrom(), "From member must not be null"); + Assert.notNull(command.getTo(), "To member must not be null"); Metric metric = command.getMetric().isPresent() ? command.getMetric().get() : RedisGeoCommands.DistanceUnit.METERS; @@ -112,8 +112,8 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getMembers(), "Members must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getMembers(), "Members must not be null"); return cmd.geohash(command.getKey(), command.getMembers().stream().toArray(ByteBuffer[]::new)).collectList() .map(value -> new MultiValueResponse<>(command, @@ -126,8 +126,8 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getMembers(), "Members must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getMembers(), "Members must not be null"); Mono>> result = cmd .geopos(command.getKey(), command.getMembers().stream().toArray(ByteBuffer[]::new)).collectList(); @@ -143,9 +143,9 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getPoint(), "Point must not be null!"); - Assert.notNull(command.getDistance(), "Distance must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getPoint(), "Point must not be null"); + Assert.notNull(command.getDistance(), "Distance must not be null"); GeoArgs geoArgs = command.getArgs().isPresent() ? LettuceConverters.toGeoArgs(command.getArgs().get()) : new GeoArgs(); @@ -166,9 +166,9 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getMember(), "Member must not be null!"); - Assert.notNull(command.getDistance(), "Distance must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getMember(), "Member must not be null"); + Assert.notNull(command.getDistance(), "Distance must not be null"); GeoArgs geoArgs = command.getArgs().isPresent() ? LettuceConverters.toGeoArgs(command.getArgs().get()) : new GeoArgs(); @@ -188,10 +188,10 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getReference(), "GeoReference must not be null!"); - Assert.notNull(command.getShape(), "GeoShape must not be null!"); - Assert.notNull(command.getArgs(), "Command args must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getReference(), "GeoReference must not be null"); + Assert.notNull(command.getShape(), "GeoShape must not be null"); + Assert.notNull(command.getArgs(), "Command args must not be null"); GeoArgs geoArgs = command.getArgs().map(LettuceConverters::toGeoArgs).orElseGet(GeoArgs::new); GeoSearch.GeoRef ref = LettuceConverters.toGeoRef(command.getReference()); @@ -209,11 +209,11 @@ class LettuceReactiveGeoCommands implements ReactiveGeoCommands { return connection.execute(cmd -> Flux.from(commands).flatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDestKey(), "Destination key must not be null!"); - Assert.notNull(command.getReference(), "GeoReference must not be null!"); - Assert.notNull(command.getShape(), "GeoShape must not be null!"); - Assert.notNull(command.getArgs(), "Command args must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDestKey(), "Destination key must not be null"); + Assert.notNull(command.getReference(), "GeoReference must not be null"); + Assert.notNull(command.getShape(), "GeoShape must not be null"); + Assert.notNull(command.getArgs(), "Command args must not be null"); GeoArgs geoArgs = command.getArgs().map(LettuceConverters::toGeoArgs).orElseGet(GeoArgs::new); Boolean storeDist = command.getArgs().map(RedisGeoCommands.GeoSearchStoreCommandArgs::isStoreDistance) diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHashCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHashCommands.java index 5d378624a..0b5fa2167 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHashCommands.java @@ -55,7 +55,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { */ LettuceReactiveHashCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -64,8 +64,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getFieldValueMap(), "FieldValueMap must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getFieldValueMap(), "FieldValueMap must not be null"); Mono result; @@ -91,8 +91,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getFields(), "Fields must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getFields(), "Fields must not be null"); Mono>> result; @@ -114,8 +114,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getName(), "Name must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getName(), "Name must not be null"); return cmd.hexists(command.getKey(), command.getField()).map(value -> new BooleanResponse<>(command, value)); })); @@ -126,8 +126,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getFields(), "Fields must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getFields(), "Fields must not be null"); return cmd.hdel(command.getKey(), command.getFields().stream().toArray(ByteBuffer[]::new)) .map(value -> new NumericResponse<>(command, value)); @@ -139,7 +139,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Command.getKey() must not be null!"); + Assert.notNull(command.getKey(), "Command.getKey() must not be null"); return cmd.hlen(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -150,7 +150,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Command.getKey() must not be null!"); + Assert.notNull(command.getKey(), "Command.getKey() must not be null"); return new CommandResponse<>(command, cmd.hrandfield(command.getKey(), command.getCount())); })); @@ -162,7 +162,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Command.getKey() must not be null!"); + Assert.notNull(command.getKey(), "Command.getKey() must not be null"); Flux> flux = cmd.hrandfieldWithvalues(command.getKey(), command.getCount()) .handle((it, sink) -> { @@ -183,7 +183,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Flux result = cmd.hkeys(command.getKey()); @@ -196,7 +196,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Flux result = cmd.hvals(command.getKey()); @@ -210,7 +210,7 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Flux> result = cmd.hgetall(command.getKey()); @@ -224,8 +224,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getOptions(), "ScanOptions must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getOptions(), "ScanOptions must not be null"); Flux> result = ScanStream.hscan(cmd, command.getKey(), LettuceConverters.toScanArgs(command.getOptions())); @@ -257,8 +257,8 @@ class LettuceReactiveHashCommands implements ReactiveHashCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getField(), "Field must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getField(), "Field must not be null"); return cmd.hstrlen(command.getKey(), command.getField()).map(value -> new NumericResponse<>(command, value)); })); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHyperLogLogCommands.java index 1b0fba226..36333380e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHyperLogLogCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveHyperLogLogCommands.java @@ -41,7 +41,7 @@ class LettuceReactiveHyperLogLogCommands implements ReactiveHyperLogLogCommands */ LettuceReactiveHyperLogLogCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -51,7 +51,7 @@ class LettuceReactiveHyperLogLogCommands implements ReactiveHyperLogLogCommands return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "key must not be null!"); + Assert.notNull(command.getKey(), "key must not be null"); return cmd.pfadd(command.getKey(), command.getValues().stream().toArray(ByteBuffer[]::new)) .map(value -> new NumericResponse<>(command, value)); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java index 01c22986d..caf79f488 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java @@ -55,7 +55,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { */ LettuceReactiveKeyCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -65,7 +65,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); CopyArgs copyArgs = CopyArgs.Builder.replace(command.isReplace()); if (command.getDatabase() != null) { @@ -82,7 +82,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.exists(command.getKey()).map(LettuceConverters.longToBooleanConverter()::convert) .map((value) -> new BooleanResponse<>(command, value)); @@ -94,7 +94,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.type(command.getKey()).map(LettuceConverters::toDataType) .map(respValue -> new CommandResponse<>(command, respValue)); @@ -106,7 +106,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(keysCollection).concatMap((keys) -> { - Assert.notEmpty(keys, "Keys must not be null!"); + Assert.notEmpty(keys, "Keys must not be null"); return cmd.touch(keys.toArray(new ByteBuffer[keys.size()])).map((value) -> new NumericResponse<>(keys, value)); })); @@ -117,7 +117,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(patterns).concatMap(pattern -> { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); // TODO: stream elements instead of collection return cmd.keys(pattern).collectList().map(value -> new MultiValueResponse<>(pattern, value)); })); @@ -126,7 +126,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { @Override public Flux scan(ScanOptions options) { - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(options, "ScanOptions must not be null"); return connection.execute(cmd -> ScanStream.scan(cmd, LettuceConverters.toScanArgs(options))); } @@ -141,8 +141,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getNewKey(), "New name must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getNewKey(), "New name must not be null"); return cmd.rename(command.getKey(), command.getNewKey()).map(LettuceConverters::stringToBoolean) .map(value -> new BooleanResponse<>(command, value)); @@ -154,8 +154,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getNewKey(), "New name must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getNewKey(), "New name must not be null"); return cmd.renamenx(command.getKey(), command.getNewKey()).map(value -> new BooleanResponse<>(command, value)); })); @@ -166,7 +166,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.del(command.getKey()).map((value) -> new NumericResponse<>(command, value)); })); @@ -177,7 +177,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(keysCollection).concatMap((keys) -> { - Assert.notEmpty(keys, "Keys must not be null!"); + Assert.notEmpty(keys, "Keys must not be null"); return cmd.del(keys.toArray(new ByteBuffer[keys.size()])).map((value) -> new NumericResponse<>(keys, value)); })); @@ -188,7 +188,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.unlink(command.getKey()).map((value) -> new NumericResponse<>(command, value)); })); @@ -199,7 +199,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(keysCollection).concatMap((keys) -> { - Assert.notEmpty(keys, "Keys must not be null!"); + Assert.notEmpty(keys, "Keys must not be null"); return cmd.unlink(keys.toArray(new ByteBuffer[keys.size()])).map((value) -> new NumericResponse<>(keys, value)); })); @@ -210,8 +210,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getTimeout(), "Timeout must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getTimeout(), "Timeout must not be null"); return cmd.expire(command.getKey(), command.getTimeout().getSeconds()) .map(value -> new BooleanResponse<>(command, value)); @@ -223,8 +223,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getTimeout(), "Timeout must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getTimeout(), "Timeout must not be null"); return cmd.pexpire(command.getKey(), command.getTimeout().toMillis()) .map(value -> new BooleanResponse<>(command, value)); @@ -236,8 +236,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getExpireAt(), "Expire at must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getExpireAt(), "Expire at must not be null"); return cmd.expireat(command.getKey(), command.getExpireAt().getEpochSecond()) .map(value -> new BooleanResponse<>(command, value)); @@ -249,8 +249,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getExpireAt(), "Expire at must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getExpireAt(), "Expire at must not be null"); return cmd.pexpireat(command.getKey(), command.getExpireAt().toEpochMilli()) .map(value -> new BooleanResponse<>(command, value)); @@ -262,7 +262,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.persist(command.getKey()).map(value -> new BooleanResponse<>(command, value)); })); @@ -273,7 +273,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.ttl(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -284,7 +284,7 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.pttl(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -295,8 +295,8 @@ class LettuceReactiveKeyCommands implements ReactiveKeyCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDatabase(), "Database must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDatabase(), "Database must not be null"); return cmd.move(command.getKey(), command.getDatabase()).map(value -> new BooleanResponse<>(command, value)); })); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveListCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveListCommands.java index 10d2c0e81..79189f92b 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveListCommands.java @@ -59,7 +59,7 @@ class LettuceReactiveListCommands implements ReactiveListCommands { */ LettuceReactiveListCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -69,12 +69,12 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notEmpty(command.getValues(), "Values must not be null or empty!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notEmpty(command.getValues(), "Values must not be null or empty"); if (!command.getUpsert() && command.getValues().size() > 1) { throw new InvalidDataAccessApiUsageException( - String.format("%s PUSHX only allows one value!", command.getDirection())); + String.format("%s PUSHX only allows one value", command.getDirection())); } Mono pushResult; @@ -98,7 +98,7 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.llen(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -109,8 +109,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Range range = command.getRange(); @@ -127,8 +127,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Range range = command.getRange(); @@ -166,8 +166,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getIndex(), "Index value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getIndex(), "Index value must not be null"); return cmd.lindex(command.getKey(), command.getIndex()).map(value -> new ByteBufferResponse<>(command, value)); })); @@ -178,10 +178,10 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.notNull(command.getPivot(), "Pivot must not be null!"); - Assert.notNull(command.getPosition(), "Position must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.notNull(command.getPivot(), "Pivot must not be null"); + Assert.notNull(command.getPosition(), "Position must not be null"); return cmd.linsert(command.getKey(), Position.BEFORE.equals(command.getPosition()), command.getPivot(), command.getValue()).map(value -> new NumericResponse<>(command, value)); @@ -193,10 +193,10 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Source key must not be null!"); - Assert.notNull(command.getFrom(), "Source direction must not be null!"); - Assert.notNull(command.getDestinationKey(), "Destination key must not be null!"); - Assert.notNull(command.getTo(), "Destination direction must not be null!"); + Assert.notNull(command.getKey(), "Source key must not be null"); + Assert.notNull(command.getFrom(), "Source direction must not be null"); + Assert.notNull(command.getDestinationKey(), "Destination key must not be null"); + Assert.notNull(command.getTo(), "Destination direction must not be null"); LMoveArgs lMoveArgs = LettuceConverters.toLmoveArgs(command.getFrom(), command.getTo()); @@ -210,11 +210,11 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.executeDedicated(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Source key must not be null!"); - Assert.notNull(command.getFrom(), "Source direction must not be null!"); - Assert.notNull(command.getDestinationKey(), "Destination key must not be null!"); - Assert.notNull(command.getTo(), "Destination direction must not be null!"); - Assert.notNull(command.getTimeout(), "Timeout must not be null!"); + Assert.notNull(command.getKey(), "Source key must not be null"); + Assert.notNull(command.getFrom(), "Source direction must not be null"); + Assert.notNull(command.getDestinationKey(), "Destination key must not be null"); + Assert.notNull(command.getTo(), "Destination direction must not be null"); + Assert.notNull(command.getTimeout(), "Timeout must not be null"); LMoveArgs lMoveArgs = LettuceConverters.toLmoveArgs(command.getFrom(), command.getTo()); double timeout = TimeoutUtils.toDoubleSeconds(command.getTimeout().toMillis(), TimeUnit.MILLISECONDS); @@ -231,9 +231,9 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "value must not be null!"); - Assert.notNull(command.getIndex(), "Index must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "value must not be null"); + Assert.notNull(command.getIndex(), "Index must not be null"); return cmd.lset(command.getKey(), command.getIndex(), command.getValue()) .map(LettuceConverters::stringToBoolean).map(value -> new BooleanResponse<>(command, value)); @@ -246,9 +246,9 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.notNull(command.getCount(), "Count must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.notNull(command.getCount(), "Count must not be null"); return cmd.lrem(command.getKey(), command.getCount(), command.getValue()) .map(value -> new NumericResponse<>(command, value)); @@ -260,8 +260,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDirection(), "Direction must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDirection(), "Direction must not be null"); Mono popResult = ObjectUtils.nullSafeEquals(Direction.RIGHT, command.getDirection()) ? cmd.rpop(command.getKey()) @@ -276,8 +276,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDirection(), "Direction must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDirection(), "Direction must not be null"); Flux popResult = ObjectUtils.nullSafeEquals(Direction.RIGHT, command.getDirection()) ? cmd.rpop(command.getKey(), command.getCount()) @@ -292,8 +292,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.executeDedicated(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); - Assert.notNull(command.getDirection(), "Direction must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); + Assert.notNull(command.getDirection(), "Direction must not be null"); long timeout = command.getTimeout().get(ChronoUnit.SECONDS); @@ -311,8 +311,8 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDestination(), "Destination key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDestination(), "Destination key must not be null"); return cmd.rpoplpush(command.getKey(), command.getDestination()) .map(value -> new ByteBufferResponse<>(command, value)); @@ -324,9 +324,9 @@ class LettuceReactiveListCommands implements ReactiveListCommands { return connection.executeDedicated(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDestination(), "Destination key must not be null!"); - Assert.notNull(command.getTimeout(), "Timeout must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDestination(), "Destination key must not be null"); + Assert.notNull(command.getTimeout(), "Timeout must not be null"); return cmd.brpoplpush(command.getTimeout().get(ChronoUnit.SECONDS), command.getKey(), command.getDestination()) diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveNumberCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveNumberCommands.java index 6c823105d..94b86ceed 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveNumberCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveNumberCommands.java @@ -41,7 +41,7 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { */ LettuceReactiveNumberCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -51,7 +51,7 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.incr(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -62,8 +62,8 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value for INCRBY must not be null."); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value for INCRBY must not be null"); T incrBy = command.getValue(); @@ -84,7 +84,7 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.decr(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -95,8 +95,8 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value for DECRBY must not be null."); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value for DECRBY must not be null"); T decrBy = command.getValue(); @@ -117,8 +117,8 @@ class LettuceReactiveNumberCommands implements ReactiveNumberCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); T incrBy = command.getValue(); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactivePubSubCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactivePubSubCommands.java index 555facfce..697a28136 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactivePubSubCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactivePubSubCommands.java @@ -54,7 +54,7 @@ class LettuceReactivePubSubCommands implements ReactivePubSubCommands { @Override public Flux publish(Publisher> messageStream) { - Assert.notNull(messageStream, "ChannelMessage stream must not be null!"); + Assert.notNull(messageStream, "ChannelMessage stream must not be null"); return connection.getCommands().flatMapMany(commands -> Flux.from(messageStream) .flatMap(message -> commands.publish(message.getChannel(), message.getMessage()))); @@ -63,7 +63,7 @@ class LettuceReactivePubSubCommands implements ReactivePubSubCommands { @Override public Mono subscribe(ByteBuffer... channels) { - Assert.notNull(channels, "Channels must not be null!"); + Assert.notNull(channels, "Channels must not be null"); return doWithPubSub(commands -> commands.subscribe(channels)); } @@ -71,7 +71,7 @@ class LettuceReactivePubSubCommands implements ReactivePubSubCommands { @Override public Mono pSubscribe(ByteBuffer... patterns) { - Assert.notNull(patterns, "Patterns must not be null!"); + Assert.notNull(patterns, "Patterns must not be null"); return doWithPubSub(commands -> commands.psubscribe(patterns)); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisClusterConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisClusterConnection.java index 55a5532a0..bd08c9707 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisClusterConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisClusterConnection.java @@ -170,7 +170,7 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Flux clusterGetReplicas(RedisClusterNode master) { - Assert.notNull(master, "Master must not be null!"); + Assert.notNull(master, "Master must not be null"); return Mono.fromSupplier(() -> lookup(master)) .flatMapMany(nodeToUse -> execute(nodeToUse, cmd -> cmd.clusterSlaves(nodeToUse.getId()) // @@ -203,7 +203,7 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Mono clusterGetNodeForKey(ByteBuffer key) { - Assert.notNull(key, "Key must not be null."); + Assert.notNull(key, "Key must not be null"); return clusterGetSlotForKey(key).flatMap(this::clusterGetNodeForSlot); } @@ -225,7 +225,7 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Mono clusterAddSlots(RedisClusterNode node, RedisClusterNode.SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); return execute(node, cmd -> cmd.clusterAddSlots(range.getSlotsArray())).then(); } @@ -243,7 +243,7 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Mono clusterDeleteSlotsInRange(RedisClusterNode node, RedisClusterNode.SlotRange range) { - Assert.notNull(range, "Range must not be null."); + Assert.notNull(range, "Range must not be null"); return execute(node, cmd -> cmd.clusterDelSlots(range.getSlotsArray())).then(); } @@ -264,9 +264,9 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Mono clusterMeet(RedisClusterNode node) { - Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command!"); - Assert.hasText(node.getHost(), "Node to meet cluster must have a host!"); - Assert.isTrue(node.getPort() != null && node.getPort() > 0, "Node to meet cluster must have a port greater 0!"); + Assert.notNull(node, "Cluster node must not be null for CLUSTER MEET command"); + Assert.hasText(node.getHost(), "Node to meet cluster must have a host"); + Assert.isTrue(node.getPort() != null && node.getPort() > 0, "Node to meet cluster must have a port greater 0"); return clusterGetNodes() .flatMap(actualNode -> execute(node, cmd -> cmd.clusterMeet(node.getHost(), node.getPort()))).then(); @@ -275,8 +275,8 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti @Override public Mono clusterSetSlot(RedisClusterNode node, int slot, AddSlots mode) { - Assert.notNull(node, "Node must not be null."); - Assert.notNull(mode, "AddSlots mode must not be null."); + Assert.notNull(node, "Node must not be null"); + Assert.notNull(mode, "AddSlots mode must not be null"); return execute(node, cmd -> { @@ -318,7 +318,7 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti */ public Flux executeCommandOnArbitraryNode(LettuceReactiveCallback callback) { - Assert.notNull(callback, "ReactiveCallback must not be null!"); + Assert.notNull(callback, "ReactiveCallback must not be null"); return Mono.fromSupplier(() -> { @@ -339,8 +339,8 @@ class LettuceReactiveRedisClusterConnection extends LettuceReactiveRedisConnecti */ public Flux execute(RedisNode node, LettuceReactiveCallback callback) { - Assert.notNull(node, "RedisClusterNode must not be null!"); - Assert.notNull(callback, "ReactiveCallback must not be null!"); + Assert.notNull(node, "RedisClusterNode must not be null"); + Assert.notNull(callback, "ReactiveCallback must not be null"); return getCommands(node).flatMapMany(callback::doWithCommands).onErrorMap(translateException()); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisConnection.java index c4bf04f07..ffa7f91bf 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisConnection.java @@ -63,7 +63,7 @@ class LettuceReactiveRedisConnection implements ReactiveRedisConnection { @SuppressWarnings("unchecked") LettuceReactiveRedisConnection(LettuceConnectionProvider connectionProvider) { - Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null!"); + Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null"); this.dedicatedConnection = new AsyncConnect(connectionProvider, StatefulConnection.class); this.pubSubConnection = new AsyncConnect(connectionProvider, StatefulRedisPubSubConnection.class); @@ -82,8 +82,8 @@ class LettuceReactiveRedisConnection implements ReactiveRedisConnection { LettuceReactiveRedisConnection(StatefulConnection sharedConnection, LettuceConnectionProvider connectionProvider) { - Assert.notNull(sharedConnection, "Shared StatefulConnection must not be null!"); - Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null!"); + Assert.notNull(sharedConnection, "Shared StatefulConnection must not be null"); + Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null"); this.dedicatedConnection = new AsyncConnect(connectionProvider, StatefulConnection.class); this.pubSubConnection = new AsyncConnect(connectionProvider, StatefulRedisPubSubConnection.class); @@ -298,8 +298,8 @@ class LettuceReactiveRedisConnection implements ReactiveRedisConnection { @SuppressWarnings("unchecked") AsyncConnect(LettuceConnectionProvider connectionProvider, Class connectionType) { - Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null!"); - Assert.notNull(connectionType, "Connection type must not be null!"); + Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null"); + Assert.notNull(connectionType, "Connection type must not be null"); this.connectionProvider = connectionProvider; @@ -318,7 +318,7 @@ class LettuceReactiveRedisConnection implements ReactiveRedisConnection { .handle((connection, sink) -> { if (isClosing(this.state.get())) { - sink.error(new IllegalStateException("Unable to connect. Connection is closed!")); + sink.error(new IllegalStateException("Unable to connect; Connection is closed")); } else { sink.next((T) connection); } @@ -335,7 +335,7 @@ class LettuceReactiveRedisConnection implements ReactiveRedisConnection { State state = this.state.get(); if (isClosing(state)) { - return Mono.error(new IllegalStateException("Unable to connect. Connection is closed!")); + return Mono.error(new IllegalStateException("Unable to connect; Connection is closed")); } this.state.compareAndSet(State.INITIAL, State.CONNECTION_REQUESTED); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveScriptingCommands.java index 0cda5f912..8c63eeacd 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveScriptingCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveScriptingCommands.java @@ -49,7 +49,7 @@ class LettuceReactiveScriptingCommands implements ReactiveScriptingCommands { */ LettuceReactiveScriptingCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -67,7 +67,7 @@ class LettuceReactiveScriptingCommands implements ReactiveScriptingCommands { @Override public Mono scriptLoad(ByteBuffer script) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); return connection.execute(cmd -> cmd.scriptLoad(ByteUtils.getBytes(script))).next(); } @@ -75,7 +75,7 @@ class LettuceReactiveScriptingCommands implements ReactiveScriptingCommands { @Override public Flux scriptExists(List scriptShas) { - Assert.notEmpty(scriptShas, "Script digests must not be empty!"); + Assert.notEmpty(scriptShas, "Script digests must not be empty"); return connection.execute(cmd -> cmd.scriptExists(scriptShas.toArray(new String[scriptShas.size()]))); } @@ -83,9 +83,9 @@ class LettuceReactiveScriptingCommands implements ReactiveScriptingCommands { @Override public Flux eval(ByteBuffer script, ReturnType returnType, int numKeys, ByteBuffer... keysAndArgs) { - Assert.notNull(script, "Script must not be null!"); - Assert.notNull(returnType, "ReturnType must not be null!"); - Assert.notNull(keysAndArgs, "Keys and args must not be null!"); + Assert.notNull(script, "Script must not be null"); + Assert.notNull(returnType, "ReturnType must not be null"); + Assert.notNull(keysAndArgs, "Keys and args must not be null"); ByteBuffer[] keys = extractScriptKeys(numKeys, keysAndArgs); ByteBuffer[] args = extractScriptArgs(numKeys, keysAndArgs); @@ -100,9 +100,9 @@ class LettuceReactiveScriptingCommands implements ReactiveScriptingCommands { @Override public Flux evalSha(String scriptSha, ReturnType returnType, int numKeys, ByteBuffer... keysAndArgs) { - Assert.notNull(scriptSha, "Script digest must not be null!"); - Assert.notNull(returnType, "ReturnType must not be null!"); - Assert.notNull(keysAndArgs, "Keys and args must not be null!"); + Assert.notNull(scriptSha, "Script digest must not be null"); + Assert.notNull(returnType, "ReturnType must not be null"); + Assert.notNull(keysAndArgs, "Keys and args must not be null"); ByteBuffer[] keys = extractScriptKeys(numKeys, keysAndArgs); ByteBuffer[] args = extractScriptArgs(numKeys, keysAndArgs); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java index 110661615..cdfc30be9 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java @@ -49,7 +49,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { */ LettuceReactiveServerCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -110,7 +110,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono info(String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); return connection.execute(c -> c.info(section)) // .map(LettuceConverters::toProperties) // @@ -120,7 +120,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono getConfig(String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); return connection.execute(c -> c.configGet(pattern)) // .map(LettuceConverters::toProperties).next(); @@ -129,8 +129,8 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono setConfig(String param, String value) { - Assert.hasText(param, "Parameter must not be null or empty!"); - Assert.hasText(value, "Value must not be null or empty!"); + Assert.hasText(param, "Parameter must not be null or empty"); + Assert.hasText(value, "Value must not be null or empty"); return connection.execute(c -> c.configSet(param, value)).next(); } @@ -152,7 +152,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono killClient(String host, int port) { - Assert.notNull(host, "Host must not be null or empty!"); + Assert.notNull(host, "Host must not be null or empty"); return connection.execute(c -> c.clientKill(String.format("%s:%s", host, port))).next(); } @@ -160,7 +160,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono setClientName(String name) { - Assert.hasText(name, "Name must not be null or empty!"); + Assert.hasText(name, "Name must not be null or empty"); return connection.execute(c -> c.clientSetname(ByteBuffer.wrap(LettuceConverters.toBytes(name)))).next(); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSetCommands.java index c94a68067..7965faeb2 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSetCommands.java @@ -49,7 +49,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { */ LettuceReactiveSetCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -59,8 +59,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValues(), "Values must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValues(), "Values must not be null"); return cmd.sadd(command.getKey(), command.getValues().toArray(new ByteBuffer[0])) .map(value -> new NumericResponse<>(command, value)); @@ -72,8 +72,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValues(), "Values must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValues(), "Values must not be null"); return cmd.srem(command.getKey(), command.getValues().toArray(new ByteBuffer[0])) .map(value -> new NumericResponse<>(command, value)); @@ -85,7 +85,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.spop(command.getKey()).map(value -> new ByteBufferResponse<>(command, value)); })); @@ -94,8 +94,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { @Override public Flux sPop(SPopCommand command) { - Assert.notNull(command, "Command must not be null!"); - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command, "Command must not be null"); + Assert.notNull(command.getKey(), "Key must not be null"); return connection.execute(cmd -> cmd.spop(command.getKey(), command.getCount())); } @@ -105,9 +105,9 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getDestination(), "Destination key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getDestination(), "Destination key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); return cmd.smove(command.getKey(), command.getDestination(), command.getValue()) .map(value -> new BooleanResponse<>(command, value)); @@ -119,7 +119,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.scard(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -130,8 +130,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); return cmd.sismember(command.getKey(), command.getValue()).map(value -> new BooleanResponse<>(command, value)); })); @@ -142,8 +142,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValues(), "Values must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValues(), "Values must not be null"); return cmd.smismember(command.getKey(), command.getValues().toArray(new ByteBuffer[0])).collectList() .map(value -> new MultiValueResponse<>(command, value)); @@ -155,7 +155,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); Flux result = cmd.sinter(command.getKeys().toArray(new ByteBuffer[0])); return Mono.just(new CommandResponse<>(command, result)); @@ -167,8 +167,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); return cmd.sinterstore(command.getKey(), command.getKeys().toArray(new ByteBuffer[0])) .map(value -> new NumericResponse<>(command, value)); @@ -180,7 +180,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); Flux result = cmd.sunion(command.getKeys().toArray(new ByteBuffer[0])); return Mono.just(new CommandResponse<>(command, result)); @@ -192,8 +192,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); return cmd.sunionstore(command.getKey(), command.getKeys().toArray(new ByteBuffer[0])) .map(value -> new NumericResponse<>(command, value)); @@ -205,7 +205,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); Flux result = cmd.sdiff(command.getKeys().toArray(new ByteBuffer[0])); return Mono.just(new CommandResponse<>(command, result)); @@ -217,8 +217,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKeys(), "Keys must not be null!"); - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKeys(), "Keys must not be null"); + Assert.notNull(command.getKey(), "Destination key must not be null"); return cmd.sdiffstore(command.getKey(), command.getKeys().toArray(new ByteBuffer[0])) .map(value -> new NumericResponse<>(command, value)); @@ -230,7 +230,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Flux result = cmd.smembers(command.getKey()); return Mono.just(new CommandResponse<>(command, result)); @@ -242,8 +242,8 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getOptions(), "ScanOptions must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getOptions(), "ScanOptions must not be null"); Flux result = ScanStream.sscan(cmd, command.getKey(), LettuceConverters.toScanArgs(command.getOptions())); @@ -258,7 +258,7 @@ class LettuceReactiveSetCommands implements ReactiveSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); boolean singleElement = !command.getCount().isPresent() || command.getCount().get().equals(1L); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStreamCommands.java index 3c8ec5a86..c9766a14a 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStreamCommands.java @@ -69,7 +69,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { */ LettuceReactiveStreamCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -78,9 +78,9 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getGroup(), "Group must not be null!"); - Assert.notNull(command.getRecordIds(), "recordIds must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getGroup(), "Group must not be null"); + Assert.notNull(command.getRecordIds(), "recordIds must not be null"); return cmd .xack(command.getKey(), ByteUtils.getByteBuffer(command.getGroup()), entryIdsToString(command.getRecordIds())) @@ -93,8 +93,8 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getBody(), "Body must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getBody(), "Body must not be null"); XAddArgs args = new XAddArgs(); if (!command.getRecord().getId().shouldBeAutoGenerated()) { @@ -149,8 +149,8 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRecordIds(), "recordIds must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRecordIds(), "recordIds must not be null"); return cmd.xdel(command.getKey(), entryIdsToString(command.getRecordIds())) .map(value -> new NumericResponse<>(command, value)); @@ -163,12 +163,12 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getGroupName(), "GroupName must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getGroupName(), "GroupName must not be null"); if (command.getAction().equals(GroupCommandAction.CREATE)) { - Assert.notNull(command.getReadOffset(), "ReadOffset must not be null!"); + Assert.notNull(command.getReadOffset(), "ReadOffset must not be null"); StreamOffset offset = StreamOffset.from(command.getKey(), command.getReadOffset().getOffset()); @@ -204,7 +204,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.xlen(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -216,7 +216,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.xpending(command.getKey(), ByteUtils.getByteBuffer(command.getGroupName())).map(it -> { return StreamConverters.toPendingMessagesInfo(command.getGroupName(), it); }).map(value -> new CommandResponse<>(command, value)); @@ -228,7 +228,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { Publisher commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); ByteBuffer groupName = ByteUtils.getByteBuffer(command.getGroupName()); io.lettuce.core.Range range = RangeConverter.toRangeWithDefault(command.getRange(), "-", "+"); @@ -251,9 +251,9 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); - Assert.notNull(command.getLimit(), "Limit must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); + Assert.notNull(command.getLimit(), "Limit must not be null"); io.lettuce.core.Range lettuceRange = RangeConverter.toRange(command.getRange(), Function.identity()); io.lettuce.core.Limit lettuceLimit = LettuceConverters.toLimit(command.getLimit()); @@ -268,8 +268,8 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return Flux.from(commands).map(command -> { - Assert.notNull(command.getStreamOffsets(), "StreamOffsets must not be null!"); - Assert.notNull(command.getReadOptions(), "ReadOptions must not be null!"); + Assert.notNull(command.getStreamOffsets(), "StreamOffsets must not be null"); + Assert.notNull(command.getReadOptions(), "ReadOptions must not be null"); StreamReadOptions readOptions = command.getReadOptions(); @@ -303,7 +303,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).flatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.xinfoStream(command.getKey()).collectList().map(XInfoStream::fromList) .map(it -> new CommandResponse<>(command, it)); @@ -316,7 +316,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return new CommandResponse<>(command, cmd.xinfoGroups(command.getKey()).map(it -> XInfoGroup.fromList((List) it))); @@ -328,7 +328,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); ByteBuffer groupName = ByteUtils.getByteBuffer(command.getGroupName()); return new CommandResponse<>(command, cmd.xinfoConsumers(command.getKey(), groupName) @@ -341,9 +341,9 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); - Assert.notNull(command.getLimit(), "Limit must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); + Assert.notNull(command.getLimit(), "Limit must not be null"); io.lettuce.core.Range lettuceRange = RangeConverter.toRange(command.getRange(), Function.identity()); io.lettuce.core.Limit lettuceLimit = LettuceConverters.toLimit(command.getLimit()); @@ -358,8 +358,8 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getCount(), "Count must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getCount(), "Count must not be null"); return cmd.xtrim(command.getKey(), command.isApproximateTrimming(), command.getCount()).map(value -> new NumericResponse<>(command, value)); })); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStringCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStringCommands.java index 9997cb734..aad56435d 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStringCommands.java @@ -58,7 +58,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { */ LettuceReactiveStringCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -68,7 +68,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(keyCollections).concatMap((keys) -> { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return cmd.mget(keys.toArray(new ByteBuffer[0])).map((value) -> value.getValueOrElse(EMPTY_BYTE_BUFFER)) .collectList().map((values) -> new MultiValueResponse<>(keys, values)); @@ -80,8 +80,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); SetArgs args = null; @@ -102,8 +102,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); if (command.getExpiration().isPresent() || command.getOption().isPresent()) { throw new IllegalArgumentException("Command must not define expiration nor option for GETSET."); @@ -119,7 +119,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.get(command.getKey()).map((value) -> new ByteBufferResponse<>(command, value)) .defaultIfEmpty(new AbsentByteBufferResponse<>(command)); @@ -131,7 +131,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.getdel(command.getKey()).map((value) -> new ByteBufferResponse<>(command, value)) .defaultIfEmpty(new AbsentByteBufferResponse<>(command)); @@ -143,7 +143,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap((command) -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); GetExArgs args = LettuceConverters.toGetExArgs(command.getExpiration()); @@ -157,8 +157,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); return cmd.setnx(command.getKey(), command.getValue()).map((value) -> new BooleanResponse<>(command, value)); })); @@ -168,9 +168,9 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { public Flux> setEX(Publisher commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.isTrue(command.getExpiration().isPresent(), "Expiration time must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.isTrue(command.getExpiration().isPresent(), "Expiration time must not be null"); return cmd.setex(command.getKey(), command.getExpiration().get().getExpirationTimeInSeconds(), command.getValue()) .map(LettuceConverters::stringToBoolean).map((value) -> new BooleanResponse<>(command, value)); @@ -182,9 +182,9 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.isTrue(command.getExpiration().isPresent(), "Expiration time must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.isTrue(command.getExpiration().isPresent(), "Expiration time must not be null"); return cmd .psetex(command.getKey(), command.getExpiration().get().getExpirationTimeInMilliseconds(), command.getValue()) @@ -197,7 +197,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notEmpty(command.getKeyValuePairs(), "Pairs must not be null or empty!"); + Assert.notEmpty(command.getKeyValuePairs(), "Pairs must not be null or empty"); return cmd.mset(command.getKeyValuePairs()).map(LettuceConverters::stringToBoolean) .map((value) -> new BooleanResponse<>(command, value)); @@ -209,7 +209,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notEmpty(command.getKeyValuePairs(), "Pairs must not be null or empty!"); + Assert.notEmpty(command.getKeyValuePairs(), "Pairs must not be null or empty"); return cmd.msetnx(command.getKeyValuePairs()).map((value) -> new BooleanResponse<>(command, value)); })); @@ -220,8 +220,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); return cmd.append(command.getKey(), command.getValue()).map((value) -> new NumericResponse<>(command, value)); })); @@ -232,8 +232,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Range range = command.getRange(); @@ -250,9 +250,9 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.notNull(command.getOffset(), "Offset must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.notNull(command.getOffset(), "Offset must not be null"); return cmd.setrange(command.getKey(), command.getOffset(), command.getValue()) .map((value) -> new NumericResponse<>(command, value)); @@ -264,8 +264,8 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getOffset(), "Offset must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getOffset(), "Offset must not be null"); return cmd.getbit(command.getKey(), command.getOffset()).map(LettuceConverters::toBoolean) .map(value -> new BooleanResponse<>(command, value)); @@ -277,9 +277,9 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); - Assert.notNull(command.getOffset(), "Offset must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); + Assert.notNull(command.getOffset(), "Offset must not be null"); return cmd.setbit(command.getKey(), command.getOffset(), command.getValue() ? 1 : 0) .map(LettuceConverters::toBoolean).map(respValue -> new BooleanResponse<>(command, respValue)); @@ -291,7 +291,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Range range = command.getRange(); @@ -307,7 +307,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); BitFieldArgs args = LettuceConverters.toBitFieldArgs(command.getSubCommands()); @@ -321,7 +321,7 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getDestinationKey(), "DestinationKey must not be null!"); + Assert.notNull(command.getDestinationKey(), "DestinationKey must not be null"); Assert.notEmpty(command.getKeys(), "Keys must not be null or empty"); Mono result = null; @@ -395,11 +395,11 @@ class LettuceReactiveStringCommands implements ReactiveStringCommands { private static > T getUpperValue(Range range) { return range.getUpperBound().getValue() - .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value!")); + .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value")); } private static > T getLowerValue(Range range) { return range.getLowerBound().getValue() - .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value!")); + .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value")); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSubscription.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSubscription.java index e42308746..ef5b837c0 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSubscription.java @@ -72,8 +72,8 @@ class LettuceReactiveSubscription implements ReactiveSubscription { @Override public Mono subscribe(ByteBuffer... channels) { - Assert.notNull(channels, "Channels must not be null!"); - Assert.noNullElements(channels, "Channels must not contain null elements!"); + Assert.notNull(channels, "Channels must not be null"); + Assert.noNullElements(channels, "Channels must not contain null elements"); return channelState.subscribe(channels, commands::subscribe); } @@ -81,8 +81,8 @@ class LettuceReactiveSubscription implements ReactiveSubscription { @Override public Mono pSubscribe(ByteBuffer... patterns) { - Assert.notNull(patterns, "Patterns must not be null!"); - Assert.noNullElements(patterns, "Patterns must not contain null elements!"); + Assert.notNull(patterns, "Patterns must not be null"); + Assert.noNullElements(patterns, "Patterns must not contain null elements"); return patternState.subscribe(patterns, commands::psubscribe); } @@ -95,8 +95,8 @@ class LettuceReactiveSubscription implements ReactiveSubscription { @Override public Mono unsubscribe(ByteBuffer... channels) { - Assert.notNull(channels, "Channels must not be null!"); - Assert.noNullElements(channels, "Channels must not contain null elements!"); + Assert.notNull(channels, "Channels must not be null"); + Assert.noNullElements(channels, "Channels must not contain null elements"); return ObjectUtils.isEmpty(channels) ? Mono.empty() : channelState.unsubscribe(channels, commands::unsubscribe); } @@ -109,8 +109,8 @@ class LettuceReactiveSubscription implements ReactiveSubscription { @Override public Mono pUnsubscribe(ByteBuffer... patterns) { - Assert.notNull(patterns, "Patterns must not be null!"); - Assert.noNullElements(patterns, "Patterns must not contain null elements!"); + Assert.notNull(patterns, "Patterns must not be null"); + Assert.noNullElements(patterns, "Patterns must not contain null elements"); return ObjectUtils.isEmpty(patterns) ? Mono.empty() : patternState.unsubscribe(patterns, commands::punsubscribe); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveZSetCommands.java index 4c215d36d..069b68f79 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveZSetCommands.java @@ -64,7 +64,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { */ LettuceReactiveZSetCommands(LettuceReactiveRedisConnection connection) { - Assert.notNull(connection, "Connection must not be null!"); + Assert.notNull(connection, "Connection must not be null"); this.connection = connection; } @@ -75,8 +75,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notEmpty(command.getTuples(), "Tuples must not be empty or null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notEmpty(command.getTuples(), "Tuples must not be empty or null"); ZAddArgs args = null; @@ -85,7 +85,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { if (command.isIncr()) { if (command.getTuples().size() > 1) { - throw new IllegalArgumentException("ZADD INCR must not contain more than one tuple!"); + throw new IllegalArgumentException("ZADD INCR must not contain more than one tuple"); } Tuple tuple = command.getTuples().iterator().next(); @@ -127,8 +127,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notEmpty(command.getValues(), "Values must not be null or empty!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notEmpty(command.getValues(), "Values must not be null or empty"); return cmd.zrem(command.getKey(), command.getValues().stream().toArray(ByteBuffer[]::new)) .map(value -> new NumericResponse<>(command, value)); @@ -140,9 +140,9 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Member must not be null!"); - Assert.notNull(command.getIncrement(), "Increment value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Member must not be null"); + Assert.notNull(command.getIncrement(), "Increment value must not be null"); return cmd.zincrby(command.getKey(), command.getIncrement().doubleValue(), command.getValue()) .map(value -> new NumericResponse<>(command, value)); @@ -155,7 +155,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return new CommandResponse<>(command, cmd.zrandmember(command.getKey(), command.getCount())); })); @@ -167,7 +167,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return new CommandResponse<>(command, cmd.zrandmemberWithScores(command.getKey(), command.getCount()) .map(this::toTuple)); @@ -179,8 +179,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); Mono result = ObjectUtils.nullSafeEquals(command.getDirection(), Direction.ASC) ? cmd.zrank(command.getKey(), command.getValue()) @@ -195,8 +195,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Flux result; @@ -231,8 +231,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); boolean isLimited = command.getLimit().isPresent() && !command.getLimit().get().isUnlimited(); @@ -295,8 +295,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getOptions(), "ScanOptions must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getOptions(), "ScanOptions must not be null"); Flux result = ScanStream.zscan(cmd, command.getKey(), LettuceConverters.toScanArgs(command.getOptions())) .map(this::toTuple); @@ -310,8 +310,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Range range = RangeConverter.toRange(command.getRange()); Mono result = cmd.zcount(command.getKey(), range); @@ -325,8 +325,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Mono result = cmd.zlexcount(command.getKey(), RangeConverter.toRange(command.getRange())); @@ -339,7 +339,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); Flux> result; if (command.getCount() > 1) { @@ -359,8 +359,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getTimeout(), "Timeout must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getTimeout(), "Timeout must not be null"); if(command.getTimeUnit() == TimeUnit.MILLISECONDS) { @@ -388,7 +388,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); return cmd.zcard(command.getKey()).map(value -> new NumericResponse<>(command, value)); })); @@ -399,8 +399,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValue(), "Value must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValue(), "Value must not be null"); return cmd.zscore(command.getKey(), command.getValue()).map(value -> new NumericResponse<>(command, value)); })); @@ -411,8 +411,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getValues(), "Values must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getValues(), "Values must not be null"); return cmd.zmscore(command.getKey(), command.getValues().toArray(new ByteBuffer[0])) .map(value -> new MultiValueResponse<>(command, value)); @@ -425,8 +425,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Mono result = cmd.zremrangebyrank(command.getKey(), // LettuceConverters.getLowerBoundIndex(command.getRange()), // @@ -442,8 +442,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Range range = RangeConverter.toRange(command.getRange()); Mono result = cmd.zremrangebyscore(command.getKey(), range); @@ -457,8 +457,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Key must not be null!"); - Assert.notNull(command.getRange(), "Range must not be null!"); + Assert.notNull(command.getKey(), "Key must not be null"); + Assert.notNull(command.getRange(), "Range must not be null"); Mono result = cmd.zremrangebylex(command.getKey(), RangeConverter.toRange(command.getRange())); @@ -471,7 +471,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getKeys(), "Keys must not be null or empty!"); + Assert.notEmpty(command.getKeys(), "Keys must not be null or empty"); ByteBuffer[] sourceKeys = command.getKeys().toArray(new ByteBuffer[0]); return new CommandResponse<>(command, cmd.zdiff(sourceKeys)); @@ -483,7 +483,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getKeys(), "Keys must not be null or empty!"); + Assert.notEmpty(command.getKeys(), "Keys must not be null or empty"); ByteBuffer[] sourceKeys = command.getKeys().toArray(new ByteBuffer[0]); return new CommandResponse<>(command, cmd.zdiffWithScores(sourceKeys).map(this::toTuple)); @@ -495,8 +495,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Destination key must not be null!"); - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notNull(command.getKey(), "Destination key must not be null"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ByteBuffer[] sourceKeys = command.getSourceKeys().toArray(new ByteBuffer[0]); return cmd.zdiffstore(command.getKey(), sourceKeys).map(value -> new NumericResponse<>(command, value)); @@ -509,7 +509,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -529,7 +529,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -550,8 +550,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Destination key must not be null!"); - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notNull(command.getKey(), "Destination key must not be null"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -572,7 +572,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -592,7 +592,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).map(command -> { - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -613,8 +613,8 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Destination key must not be null!"); - Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!"); + Assert.notNull(command.getKey(), "Destination key must not be null"); + Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty"); ZStoreArgs args = null; if (command.getAggregateFunction().isPresent() || !command.getWeights().isEmpty()) { @@ -635,7 +635,7 @@ class LettuceReactiveZSetCommands implements ReactiveZSetCommands { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { - Assert.notNull(command.getKey(), "Destination key must not be null!"); + Assert.notNull(command.getKey(), "Destination key must not be null"); Flux result; diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScanCursor.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScanCursor.java index 8cfac8738..c92fd9b5e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScanCursor.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScanCursor.java @@ -59,7 +59,7 @@ abstract class LettuceScanCursor extends ScanCursor { } } - throw new IllegalArgumentException(String.format("Current scan %s state and cursor %d do not match!", + throw new IllegalArgumentException(String.format("Current scan %s state and cursor %d do not match", state != null ? state.getCursor() : "(none)", cursorId)); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScriptingCommands.java index 4f31ae2f4..a0a97f0ea 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScriptingCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceScriptingCommands.java @@ -56,7 +56,7 @@ class LettuceScriptingCommands implements RedisScriptingCommands { @Override public String scriptLoad(byte[] script) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); return connection.invoke().just(RedisScriptingAsyncCommands::scriptLoad, script); } @@ -64,8 +64,8 @@ class LettuceScriptingCommands implements RedisScriptingCommands { @Override public List scriptExists(String... scriptSha1) { - Assert.notNull(scriptSha1, "Script digests must not be null!"); - Assert.noNullElements(scriptSha1, "Script digests must not contain null elements!"); + Assert.notNull(scriptSha1, "Script digests must not be null"); + Assert.noNullElements(scriptSha1, "Script digests must not contain null elements"); return connection.invoke().just(RedisScriptingAsyncCommands::scriptExists, scriptSha1); } @@ -73,7 +73,7 @@ class LettuceScriptingCommands implements RedisScriptingCommands { @Override public T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(script, "Script must not be null!"); + Assert.notNull(script, "Script must not be null"); byte[][] keys = extractScriptKeys(numKeys, keysAndArgs); byte[][] args = extractScriptArgs(numKeys, keysAndArgs); @@ -88,7 +88,7 @@ class LettuceScriptingCommands implements RedisScriptingCommands { @Override public T evalSha(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(scriptSha1, "Script digest must not be null!"); + Assert.notNull(scriptSha1, "Script digest must not be null"); byte[][] keys = extractScriptKeys(numKeys, keysAndArgs); byte[][] args = extractScriptArgs(numKeys, keysAndArgs); @@ -102,7 +102,7 @@ class LettuceScriptingCommands implements RedisScriptingCommands { @Override public T evalSha(byte[] scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs) { - Assert.notNull(scriptSha1, "Script digest must not be null!"); + Assert.notNull(scriptSha1, "Script digest must not be null"); return evalSha(LettuceConverters.toString(scriptSha1), returnType, numKeys, keysAndArgs); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSentinelConnection.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSentinelConnection.java index 85cdb59a9..d62290b65 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSentinelConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSentinelConnection.java @@ -141,7 +141,7 @@ public class LettuceSentinelConnection implements RedisSentinelConnection { */ public LettuceSentinelConnection(LettuceConnectionProvider connectionProvider) { - Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null!"); + Assert.notNull(connectionProvider, "LettuceConnectionProvider must not be null"); this.provider = connectionProvider; init(); } @@ -206,7 +206,7 @@ public class LettuceSentinelConnection implements RedisSentinelConnection { public void monitor(RedisServer server) { Assert.notNull(server, "Cannot monitor 'null' server."); - Assert.hasText(server.getName(), "Name of server to monitor must not be 'null' or empty."); + Assert.hasText(server.getName(), "Name of server to monitor must not be 'null' or empty"); Assert.hasText(server.getHost(), "Host must not be 'null' for server to monitor."); Assert.notNull(server.getPort(), "Port must not be 'null' for server to monitor."); Assert.notNull(server.getQuorum(), "Quorum must not be 'null' for server to monitor."); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java index 1a5c4e42c..0e32e2c01 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java @@ -99,7 +99,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public Properties info(String section) { - Assert.hasText(section, "Section must not be null or empty!"); + Assert.hasText(section, "Section must not be null or empty"); return connection.invoke().from(RedisServerAsyncCommands::info, section).get(LettuceConverters.stringToProps()); } @@ -135,7 +135,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public Properties getConfig(String pattern) { - Assert.hasText(pattern, "Pattern must not be null or empty!"); + Assert.hasText(pattern, "Pattern must not be null or empty"); return connection.invoke().from(RedisServerAsyncCommands::configGet, pattern) .get(LettuceConverters.mapToPropertiesConverter()); @@ -144,8 +144,8 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void setConfig(String param, String value) { - Assert.hasText(param, "Parameter must not be null or empty!"); - Assert.hasText(value, "Value must not be null or empty!"); + Assert.hasText(param, "Parameter must not be null or empty"); + Assert.hasText(value, "Value must not be null or empty"); connection.invokeStatus().just(RedisServerAsyncCommands::configSet, param, value); } @@ -163,7 +163,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public Long time(TimeUnit timeUnit) { - Assert.notNull(timeUnit, "TimeUnit must not be null."); + Assert.notNull(timeUnit, "TimeUnit must not be null"); return connection.invoke().from(RedisServerAsyncCommands::time).get(LettuceConverters.toTimeConverter(timeUnit)); } @@ -171,7 +171,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void killClient(String host, int port) { - Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'."); + Assert.hasText(host, "Host for 'CLIENT KILL' must not be 'null' or 'empty'"); String client = String.format("%s:%s", host, port); @@ -181,7 +181,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void setClientName(byte[] name) { - Assert.notNull(name, "Name must not be null!"); + Assert.notNull(name, "Name must not be null"); connection.invoke().just(RedisServerAsyncCommands::clientSetname, name); } @@ -200,7 +200,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void replicaOf(String host, int port) { - Assert.hasText(host, "Host must not be null for 'REPLICAOF' command."); + Assert.hasText(host, "Host must not be null for 'REPLICAOF' command"); connection.invoke().just(RedisServerAsyncCommands::slaveof, host, port); } @@ -218,8 +218,8 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(target, "Target node must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(target, "Target node must not be null"); connection.invoke().just(RedisKeyAsyncCommands::migrate, target.getHost(), target.getPort(), key, dbIndex, timeout); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSetCommands.java index 6a69fd351..35e7c482d 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSetCommands.java @@ -48,9 +48,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sAdd(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sadd, key, values); } @@ -58,7 +58,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSetAsyncCommands::scard, key); } @@ -66,8 +66,8 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Set sDiff(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sdiff, keys); } @@ -75,9 +75,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sDiffStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sdiffstore, destKey, keys); } @@ -85,8 +85,8 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Set sInter(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sinter, keys); } @@ -94,9 +94,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sInterStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sinterstore, destKey, keys); } @@ -104,8 +104,8 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Boolean sIsMember(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisSetAsyncCommands::sismember, key, value); } @@ -113,9 +113,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public List sMIsMember(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::smismember, key, values); } @@ -123,7 +123,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Set sMembers(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSetAsyncCommands::smembers, key); } @@ -131,9 +131,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) { - Assert.notNull(srcKey, "Source key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(srcKey, "Source key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisSetAsyncCommands::smove, srcKey, destKey, value); } @@ -141,7 +141,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public byte[] sPop(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSetAsyncCommands::spop, key); } @@ -149,7 +149,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public List sPop(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisSetAsyncCommands::spop, key, count).get(ArrayList::new); } @@ -157,7 +157,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public byte[] sRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSetAsyncCommands::srandmember, key); } @@ -165,7 +165,7 @@ class LettuceSetCommands implements RedisSetCommands { @Override public List sRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSetAsyncCommands::srandmember, key, count); } @@ -173,9 +173,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::srem, key, values); } @@ -183,8 +183,8 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Set sUnion(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sunion, keys); } @@ -192,9 +192,9 @@ class LettuceSetCommands implements RedisSetCommands { @Override public Long sUnionStore(byte[] destKey, byte[]... keys) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(keys, "Source keys must not be null!"); - Assert.noNullElements(keys, "Source keys must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(keys, "Source keys must not be null"); + Assert.noNullElements(keys, "Source keys must not contain null elements"); return connection.invoke().just(RedisSetAsyncCommands::sunionstore, destKey, keys); } @@ -213,7 +213,7 @@ class LettuceSetCommands implements RedisSetCommands { */ public Cursor sScan(byte[] key, long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor(key, cursorId, options) { @@ -221,7 +221,7 @@ class LettuceSetCommands implements RedisSetCommands { protected ScanIteration doScan(byte[] key, long cursorId, ScanOptions options) { if (connection.isQueueing() || connection.isPipelined()) { - throw new InvalidDataAccessApiUsageException("'SSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'SSCAN' cannot be called in pipeline / transaction mode"); } io.lettuce.core.ScanCursor scanCursor = connection.getScanCursor(cursorId); diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStreamCommands.java index b10c264c0..1f19aa242 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStreamCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStreamCommands.java @@ -63,9 +63,9 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Long xAck(byte[] key, String group, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(group, "Group name must not be null or empty!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(group, "Group name must not be null or empty"); + Assert.notNull(recordIds, "recordIds must not be null"); String[] ids = entryIdsToString(recordIds); @@ -75,8 +75,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public RecordId xAdd(MapRecord record, XAddOptions options) { - Assert.notNull(record.getStream(), "Stream must not be null!"); - Assert.notNull(record, "Record must not be null!"); + Assert.notNull(record.getStream(), "Stream must not be null"); + Assert.notNull(record, "Record must not be null"); XAddArgs args = new XAddArgs(); args.id(record.getId().getValue()); @@ -120,8 +120,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Long xDel(byte[] key, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "recordIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "recordIds must not be null"); return connection.invoke().just(RedisStreamAsyncCommands::xdel, key, entryIdsToString(recordIds)); } @@ -134,9 +134,9 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public String xGroupCreate(byte[] key, String groupName, ReadOffset readOffset, boolean mkSteam) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); - Assert.notNull(readOffset, "ReadOffset must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); + Assert.notNull(readOffset, "ReadOffset must not be null"); XReadArgs.StreamOffset streamOffset = XReadArgs.StreamOffset.from(key, readOffset.getOffset()); @@ -147,8 +147,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDelConsumer(byte[] key, Consumer consumer) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); io.lettuce.core.Consumer lettuceConsumer = toConsumer(consumer); @@ -159,8 +159,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Boolean xGroupDestroy(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(groupName, "Group name must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(groupName, "Group name must not be null or empty"); return connection.invoke().just(RedisStreamAsyncCommands::xgroupDestroy, key, LettuceConverters.toBytes(groupName)); } @@ -168,7 +168,7 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public XInfoStream xInfo(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisStreamAsyncCommands::xinfoStream, key).get(XInfoStream::fromList); } @@ -176,7 +176,7 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public XInfoGroups xInfoGroups(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisStreamAsyncCommands::xinfoGroups, key).get(XInfoGroups::fromList); } @@ -184,8 +184,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public XInfoConsumers xInfoConsumers(byte[] key, String groupName) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(groupName, "GroupName must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(groupName, "GroupName must not be null"); return connection.invoke().from(RedisStreamAsyncCommands::xinfoConsumers, key, LettuceConverters.toBytes(groupName)) .get(it -> XInfoConsumers.fromList(groupName, it)); @@ -194,7 +194,7 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Long xLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStreamAsyncCommands::xlen, key); } @@ -232,9 +232,9 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public List xRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); io.lettuce.core.Range lettuceRange = RangeConverter.toRange(range, Function.identity()); io.lettuce.core.Limit lettuceLimit = LettuceConverters.toLimit(limit); @@ -246,8 +246,8 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public List xRead(StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadArgs.StreamOffset[] streamOffsets = toStreamOffsets(streams); XReadArgs args = StreamConverters.toReadArgs(readOptions); @@ -267,9 +267,9 @@ class LettuceStreamCommands implements RedisStreamCommands { public List xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "StreamOffsets must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "StreamOffsets must not be null"); XReadArgs.StreamOffset[] streamOffsets = toStreamOffsets(streams); XReadArgs args = StreamConverters.toReadArgs(readOptions); @@ -289,9 +289,9 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public List xRevRange(byte[] key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); io.lettuce.core.Range lettuceRange = RangeConverter.toRange(range, Function.identity()); io.lettuce.core.Limit lettuceLimit = LettuceConverters.toLimit(limit); @@ -308,7 +308,7 @@ class LettuceStreamCommands implements RedisStreamCommands { @Override public Long xTrim(byte[] key, long count, boolean approximateTrimming) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStreamAsyncCommands::xtrim, key, approximateTrimming, count); } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStringCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStringCommands.java index a399924fe..be2a1d73d 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceStringCommands.java @@ -47,7 +47,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public byte[] get(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::get, key); } @@ -56,7 +56,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public byte[] getDel(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::getdel, key); } @@ -65,8 +65,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public byte[] getEx(byte[] key, Expiration expiration) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); return connection.invoke().just(RedisStringAsyncCommands::getex, key, LettuceConverters.toGetExArgs(expiration)); } @@ -74,8 +74,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public byte[] getSet(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisStringAsyncCommands::getset, key, value); } @@ -83,8 +83,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public List mGet(byte[]... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return connection.invoke().fromMany(RedisStringAsyncCommands::mget, keys) .toList(source -> source.getValueOrElse(null)); @@ -93,8 +93,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(RedisStringAsyncCommands::set, key, value) .get(Converters.stringToBooleanConverter()); @@ -103,10 +103,10 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean set(byte[] key, byte[] value, Expiration expiration, SetOption option) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); - Assert.notNull(expiration, "Expiration must not be null!"); - Assert.notNull(option, "Option must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); + Assert.notNull(expiration, "Expiration must not be null"); + Assert.notNull(option, "Option must not be null"); return connection.invoke() .from(RedisStringAsyncCommands::set, key, value, LettuceConverters.toSetArgs(expiration, option)) @@ -116,8 +116,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean setNX(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisStringAsyncCommands::setnx, key, value); } @@ -125,8 +125,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean setEx(byte[] key, long seconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(RedisStringAsyncCommands::setex, key, seconds, value) .get(Converters.stringToBooleanConverter()); @@ -135,8 +135,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean pSetEx(byte[] key, long milliseconds, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().from(RedisStringAsyncCommands::psetex, key, milliseconds, value) .get(Converters.stringToBooleanConverter()); @@ -145,7 +145,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean mSet(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().from(RedisStringAsyncCommands::mset, tuples).get(Converters.stringToBooleanConverter()); } @@ -153,7 +153,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean mSetNX(Map tuples) { - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().just(RedisStringAsyncCommands::msetnx, tuples); } @@ -161,7 +161,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long incr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::incr, key); } @@ -169,7 +169,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long incrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::incrby, key, value); } @@ -177,7 +177,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Double incrBy(byte[] key, double value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::incrbyfloat, key, value); } @@ -185,7 +185,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long decr(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::decr, key); } @@ -193,7 +193,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long decrBy(byte[] key, long value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::decrby, key, value); } @@ -201,8 +201,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long append(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisStringAsyncCommands::append, key, value); } @@ -210,7 +210,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public byte[] getRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::getrange, key, start, end); } @@ -218,8 +218,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public void setRange(byte[] key, byte[] value, long offset) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); connection.invokeStatus().just(RedisStringAsyncCommands::setrange, key, offset, value); } @@ -227,7 +227,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean getBit(byte[] key, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisStringAsyncCommands::getbit, key, offset) .get(LettuceConverters.longToBoolean()); @@ -236,7 +236,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Boolean setBit(byte[] key, long offset, boolean value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisStringAsyncCommands::setbit, key, offset, LettuceConverters.toInt(value)) .get(LettuceConverters.longToBoolean()); @@ -245,7 +245,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::bitcount, key); } @@ -253,7 +253,7 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long bitCount(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::bitcount, key, start, end); } @@ -261,8 +261,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public List bitField(byte[] key, BitFieldSubCommands subCommands) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(subCommands, "Command must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(subCommands, "Command must not be null"); BitFieldArgs args = LettuceConverters.toBitFieldArgs(subCommands); @@ -272,8 +272,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long bitOp(BitOperation op, byte[] destination, byte[]... keys) { - Assert.notNull(op, "BitOperation must not be null!"); - Assert.notNull(destination, "Destination key must not be null!"); + Assert.notNull(op, "BitOperation must not be null"); + Assert.notNull(destination, "Destination key must not be null"); if (op == BitOperation.NOT && keys.length > 1) { throw new IllegalArgumentException("Bitop NOT should only be performed against one key"); @@ -303,8 +303,8 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long bitPos(byte[] key, boolean bit, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null! Use Range.unbounded() instead."); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null Use Range.unbounded() instead"); if (range.getLowerBound().isBounded()) { @@ -322,18 +322,18 @@ class LettuceStringCommands implements RedisStringCommands { @Override public Long strLen(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisStringAsyncCommands::strlen, key); } private static > T getUpperValue(Range range) { return range.getUpperBound().getValue() - .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value!")); + .orElseThrow(() -> new IllegalArgumentException("Range does not contain upper bound value")); } private static > T getLowerValue(Range range) { return range.getLowerBound().getValue() - .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value!")); + .orElseThrow(() -> new IllegalArgumentException("Range does not contain lower bound value")); } } diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceZSetCommands.java index 372924036..b26fe9d38 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceZSetCommands.java @@ -59,8 +59,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Boolean zAdd(byte[] key, double score, byte[] value, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke() .from(RedisSortedSetAsyncCommands::zadd, key, LettuceZSetCommands.toZAddArgs(args), score, value) @@ -70,8 +70,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zAdd(byte[] key, Set tuples, ZAddArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(tuples, "Tuples must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(tuples, "Tuples must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zadd, key, LettuceZSetCommands.toZAddArgs(args), LettuceConverters.toObjects(tuples).toArray()); @@ -80,9 +80,9 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRem(byte[] key, byte[]... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); + Assert.noNullElements(values, "Values must not contain null elements"); return connection.invoke().just(RedisSortedSetAsyncCommands::zrem, key, values); } @@ -90,8 +90,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Double zIncrBy(byte[] key, double increment, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zincrby, key, increment, value); } @@ -99,7 +99,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public byte[] zRandMember(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zrandmember, key); } @@ -107,7 +107,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public List zRandMember(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zrandmember, key, count); } @@ -115,7 +115,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Tuple zRandMemberWithScore(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisSortedSetAsyncCommands::zrandmemberWithScores, key) .get(LettuceConverters::toTuple); @@ -124,7 +124,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public List zRandMemberWithScore(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrandmemberWithScores, key, count) .toList(LettuceConverters::toTuple); @@ -133,8 +133,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zrank, key, value); } @@ -142,7 +142,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRevRank(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zrevrank, key, value); } @@ -150,7 +150,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrange, key, start, end).toSet(); } @@ -158,7 +158,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrangeWithScores, key, start, end) .toSet(LettuceConverters::toTuple); @@ -168,9 +168,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYSCOREWITHSCORES must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYSCOREWITHSCORES must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrangebyscoreWithScores, key, @@ -187,7 +187,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRevRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrevrange, key, start, end) .toSet(Converters.identityConverter()); @@ -196,7 +196,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRevRangeWithScores(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrevrangeWithScores, key, start, end) .toSet(LettuceConverters::toTuple); @@ -206,9 +206,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRevRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYSCORE must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYSCORE must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { @@ -226,9 +226,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYSCOREWITHSCORES must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYSCOREWITHSCORES must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrevrangebyscoreWithScores, key, @@ -245,7 +245,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zcount, key, LettuceConverters. toRange(range)); @@ -254,8 +254,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zLexCount(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zlexcount, key, LettuceConverters. toRange(range, true)); @@ -265,7 +265,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMin(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisSortedSetAsyncCommands::zpopmin, key).get(LettuceConverters::toTuple); } @@ -274,7 +274,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zPopMin(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zpopmin, key, count) .toSet(LettuceConverters::toTuple); @@ -284,8 +284,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMin(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); if(TimeUnit.MILLISECONDS == unit) { @@ -303,7 +303,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Tuple zPopMax(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().from(RedisSortedSetAsyncCommands::zpopmax, key).get(LettuceConverters::toTuple); } @@ -312,7 +312,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zPopMax(byte[] key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zpopmax, key, count) .toSet(LettuceConverters::toTuple); @@ -322,8 +322,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Tuple bZPopMax(byte[] key, long timeout, TimeUnit unit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(unit, "TimeUnit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(unit, "TimeUnit must not be null"); if(TimeUnit.MILLISECONDS == unit) { @@ -340,7 +340,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zCard(byte[] key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zcard, key); } @@ -348,8 +348,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Double zScore(byte[] key, byte[] value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zscore, key, value); } @@ -357,8 +357,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public List zMScore(byte[] key, byte[][] values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Value must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zmscore, key, values); } @@ -366,7 +366,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRemRange(byte[] key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zremrangebyrank, key, start, end); } @@ -374,8 +374,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByLex(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null for ZREMRANGEBYLEX"); return connection.invoke().just(RedisSortedSetAsyncCommands::zremrangebylex, key, LettuceConverters. toRange(range, true)); @@ -384,8 +384,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zRemRangeByScore(byte[] key, org.springframework.data.domain.Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREMRANGEBYSCORE must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREMRANGEBYSCORE must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zremrangebyscore, key, LettuceConverters. toRange(range)); @@ -394,7 +394,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zDiff(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zdiff, sets).toSet(); } @@ -402,7 +402,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zDiffWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zdiffWithScores, sets) .toSet(LettuceConverters::toTuple); @@ -411,8 +411,8 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zDiffStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); return connection.invoke().just(RedisSortedSetAsyncCommands::zdiffstore, destKey, sets); } @@ -420,7 +420,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zInter(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zinter, sets).toSet(); } @@ -428,7 +428,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zinterWithScores, sets) .toSet(LettuceConverters::toTuple); @@ -437,10 +437,10 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zInterWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZAggregateArgs zAggregateArgs = zAggregateArgs(aggregate, weights); @@ -451,11 +451,11 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZStoreArgs storeArgs = zStoreArgs(aggregate, weights); @@ -465,9 +465,9 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zInterStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); return connection.invoke().just(RedisSortedSetAsyncCommands::zinterstore, destKey, sets); } @@ -475,7 +475,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zUnion(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zunion, sets).toSet(); } @@ -483,7 +483,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); + Assert.notNull(sets, "Sets must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zunionWithScores, sets) .toSet(LettuceConverters::toTuple); @@ -492,10 +492,10 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zUnionWithScores(Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(sets, "Sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(sets, "Sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZAggregateArgs zAggregateArgs = zAggregateArgs(aggregate, weights); @@ -506,11 +506,11 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); Assert.isTrue(weights.size() == sets.length, () -> String - .format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length)); + .format("The number of weights (%d) must match the number of source sets (%d)", weights.size(), sets.length)); ZStoreArgs storeArgs = zStoreArgs(aggregate, weights); @@ -520,9 +520,9 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Long zUnionStore(byte[] destKey, byte[]... sets) { - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(sets, "Source sets must not be null!"); - Assert.noNullElements(sets, "Source sets must not contain null elements!"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(sets, "Source sets must not be null"); + Assert.noNullElements(sets, "Source sets must not contain null elements"); return connection.invoke().just(RedisSortedSetAsyncCommands::zunionstore, destKey, sets); } @@ -541,7 +541,7 @@ class LettuceZSetCommands implements RedisZSetCommands { */ public Cursor zScan(byte[] key, long cursorId, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return new KeyBoundCursor(key, cursorId, options) { @@ -549,7 +549,7 @@ class LettuceZSetCommands implements RedisZSetCommands { protected ScanIteration doScan(byte[] key, long cursorId, ScanOptions options) { if (connection.isQueueing() || connection.isPipelined()) { - throw new InvalidDataAccessApiUsageException("'ZSCAN' cannot be called in pipeline / transaction mode."); + throw new InvalidDataAccessApiUsageException("'ZSCAN' cannot be called in pipeline / transaction mode"); } io.lettuce.core.ScanCursor scanCursor = connection.getScanCursor(cursorId); @@ -576,7 +576,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrangebyscore, key, min, max).toSet(); } @@ -584,7 +584,7 @@ class LettuceZSetCommands implements RedisZSetCommands { @Override public Set zRangeByScore(byte[] key, String min, String max, long offset, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return connection.invoke().fromMany(RedisSortedSetAsyncCommands::zrangebyscore, key, min, max, offset, count) .toSet(); @@ -594,9 +594,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRangeByScore(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYSCORE must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYSCORE must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { return connection.invoke() @@ -611,9 +611,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZRANGEBYLEX must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZRANGEBYLEX must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { return connection.invoke() @@ -629,9 +629,9 @@ class LettuceZSetCommands implements RedisZSetCommands { public Set zRevRangeByLex(byte[] key, org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range for ZREVRANGEBYLEX must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range for ZREVRANGEBYLEX must not be null"); + Assert.notNull(limit, "Limit must not be null"); if (limit.isUnlimited()) { return connection.invoke() diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/StandaloneConnectionProvider.java b/src/main/java/org/springframework/data/redis/connection/lettuce/StandaloneConnectionProvider.java index e4e5a8937..6097d603e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/StandaloneConnectionProvider.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/StandaloneConnectionProvider.java @@ -111,7 +111,7 @@ class StandaloneConnectionProvider implements LettuceConnectionProvider, TargetA .orElseGet(() -> client.connect(codec))); } - throw new UnsupportedOperationException("Connection type " + connectionType + " not supported!"); + throw new UnsupportedOperationException("Connection type " + connectionType + " not supported"); } @Override @@ -139,7 +139,7 @@ class StandaloneConnectionProvider implements LettuceConnectionProvider, TargetA } return LettuceFutureUtils - .failed(new UnsupportedOperationException("Connection type " + connectionType + " not supported!")); + .failed(new UnsupportedOperationException("Connection type " + connectionType + " not supported")); } private StatefulRedisConnection masterReplicaConnection(RedisURI redisUri, ReadFrom readFrom) { diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/StaticMasterReplicaConnectionProvider.java b/src/main/java/org/springframework/data/redis/connection/lettuce/StaticMasterReplicaConnectionProvider.java index 475cb476f..b21ec2a04 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/StaticMasterReplicaConnectionProvider.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/StaticMasterReplicaConnectionProvider.java @@ -79,7 +79,7 @@ class StaticMasterReplicaConnectionProvider implements LettuceConnectionProvider return connectionType.cast(connection); } - throw new UnsupportedOperationException(String.format("Connection type %s not supported!", connectionType)); + throw new UnsupportedOperationException(String.format("Connection type %s not supported", connectionType)); } @Override @@ -97,6 +97,6 @@ class StaticMasterReplicaConnectionProvider implements LettuceConnectionProvider }); } - throw new UnsupportedOperationException(String.format("Connection type %s not supported!", connectionType)); + throw new UnsupportedOperationException(String.format("Connection type %s not supported", connectionType)); } } diff --git a/src/main/java/org/springframework/data/redis/connection/stream/Record.java b/src/main/java/org/springframework/data/redis/connection/stream/Record.java index 931490263..007b27854 100644 --- a/src/main/java/org/springframework/data/redis/connection/stream/Record.java +++ b/src/main/java/org/springframework/data/redis/connection/stream/Record.java @@ -81,7 +81,7 @@ public interface Record { */ static MapRecord of(Map map) { - Assert.notNull(map, "Map must not be null!"); + Assert.notNull(map, "Map must not be null"); return StreamRecords.mapBacked(map); } @@ -96,7 +96,7 @@ public interface Record { */ static ObjectRecord of(V value) { - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(value, "Value must not be null"); return StreamRecords.objectBacked(value); } diff --git a/src/main/java/org/springframework/data/redis/connection/stream/RecordId.java b/src/main/java/org/springframework/data/redis/connection/stream/RecordId.java index fd377fe07..416ce2dd2 100644 --- a/src/main/java/org/springframework/data/redis/connection/stream/RecordId.java +++ b/src/main/java/org/springframework/data/redis/connection/stream/RecordId.java @@ -83,7 +83,7 @@ public class RecordId { } Assert.isTrue(value.contains(DELIMITER), - "Invalid id format. Please use the 'millisecondsTime-sequenceNumber' format."); + "Invalid id format; Please use the 'millisecondsTime-sequenceNumber' format"); return new RecordId(value); } diff --git a/src/main/java/org/springframework/data/redis/connection/stream/StreamInfo.java b/src/main/java/org/springframework/data/redis/connection/stream/StreamInfo.java index 57b93a9d7..c316918bb 100644 --- a/src/main/java/org/springframework/data/redis/connection/stream/StreamInfo.java +++ b/src/main/java/org/springframework/data/redis/connection/stream/StreamInfo.java @@ -73,7 +73,7 @@ public class StreamInfo { T value = get(entry, type); if (value == null) { - throw new IllegalStateException("Value for entry '%s' is null.".formatted(entry)); + throw new IllegalStateException("Value for entry '%s' is null".formatted(entry)); } return value; } diff --git a/src/main/java/org/springframework/data/redis/connection/stream/StreamReadOptions.java b/src/main/java/org/springframework/data/redis/connection/stream/StreamReadOptions.java index 473db11ff..41befe20a 100644 --- a/src/main/java/org/springframework/data/redis/connection/stream/StreamReadOptions.java +++ b/src/main/java/org/springframework/data/redis/connection/stream/StreamReadOptions.java @@ -82,8 +82,8 @@ public class StreamReadOptions { */ public StreamReadOptions block(Duration timeout) { - Assert.notNull(timeout, "Block timeout must not be null!"); - Assert.isTrue(!timeout.isNegative(), "Block timeout must not be negative!"); + Assert.notNull(timeout, "Block timeout must not be null"); + Assert.isTrue(!timeout.isNegative(), "Block timeout must not be negative"); return new StreamReadOptions(timeout.toMillis(), count, noack); } @@ -96,7 +96,7 @@ public class StreamReadOptions { */ public StreamReadOptions count(long count) { - Assert.isTrue(count > 0, "Count must be greater or equal to zero!"); + Assert.isTrue(count > 0, "Count must be greater or equal to zero"); return new StreamReadOptions(block, count, noack); } diff --git a/src/main/java/org/springframework/data/redis/connection/stream/StreamRecords.java b/src/main/java/org/springframework/data/redis/connection/stream/StreamRecords.java index bf6f8cbcd..f317cabc6 100644 --- a/src/main/java/org/springframework/data/redis/connection/stream/StreamRecords.java +++ b/src/main/java/org/springframework/data/redis/connection/stream/StreamRecords.java @@ -216,7 +216,7 @@ public class StreamRecords { } else if (stream instanceof byte[]) { streamKey = ByteBuffer.wrap((byte[]) stream); } else { - throw new IllegalArgumentException(String.format("Stream key %s cannot be converted to byte buffer.", stream)); + throw new IllegalArgumentException(String.format("Stream key %s cannot be converted to byte buffer", stream)); } return new ByteBufferMapBackedRecord(streamKey, id, value); diff --git a/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java b/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java index 0f1f439c3..7dc482193 100644 --- a/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java @@ -55,7 +55,7 @@ public abstract class AbstractSubscription implements Subscription { */ protected AbstractSubscription(MessageListener listener, @Nullable byte[][] channels, @Nullable byte[][] patterns) { - Assert.notNull(listener, "MessageListener must not be null!"); + Assert.notNull(listener, "MessageListener must not be null"); this.listener = listener; diff --git a/src/main/java/org/springframework/data/redis/connection/zset/Weights.java b/src/main/java/org/springframework/data/redis/connection/zset/Weights.java index 946aa7416..48ae8d7f5 100644 --- a/src/main/java/org/springframework/data/redis/connection/zset/Weights.java +++ b/src/main/java/org/springframework/data/redis/connection/zset/Weights.java @@ -51,7 +51,7 @@ public class Weights { */ public static Weights of(int... weights) { - Assert.notNull(weights, "Weights must not be null!"); + Assert.notNull(weights, "Weights must not be null"); return new Weights(Arrays.stream(weights).mapToDouble(value -> value).boxed().collect(Collectors.toList())); } @@ -63,7 +63,7 @@ public class Weights { */ public static Weights of(double... weights) { - Assert.notNull(weights, "Weights must not be null!"); + Assert.notNull(weights, "Weights must not be null"); return new Weights(DoubleStream.of(weights).boxed().collect(Collectors.toList())); } @@ -76,7 +76,7 @@ public class Weights { */ public static Weights fromSetCount(int count) { - Assert.isTrue(count >= 0, "Count of input sorted sets must be greater or equal to zero!"); + Assert.isTrue(count >= 0, "Count of input sorted sets must be greater or equal to zero"); return new Weights(IntStream.range(0, count).mapToDouble(value -> 1).boxed().collect(Collectors.toList())); } diff --git a/src/main/java/org/springframework/data/redis/core/AbstractOperations.java b/src/main/java/org/springframework/data/redis/core/AbstractOperations.java index 49df0b775..3974d28f4 100644 --- a/src/main/java/org/springframework/data/redis/core/AbstractOperations.java +++ b/src/main/java/org/springframework/data/redis/core/AbstractOperations.java @@ -146,8 +146,8 @@ abstract class AbstractOperations { */ byte[][] rawValues(Collection values) { - Assert.notEmpty(values, "Values must not be 'null' or empty."); - Assert.noNullElements(values.toArray(), "Values must not contain 'null' value."); + Assert.notEmpty(values, "Values must not be 'null' or empty"); + Assert.noNullElements(values.toArray(), "Values must not contain 'null' value"); byte[][] rawValues = new byte[values.size()][]; int i = 0; diff --git a/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java b/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java index 95352acb9..9101377bf 100644 --- a/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java +++ b/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java @@ -78,7 +78,7 @@ class BoundOperationsProxyFactory { Method target = lookupMethod(method, targetClass, considerKeyArgument); if (target == null) { - throw new IllegalArgumentException("Cannot lookup target method for %s in class %s. This appears to be a bug." + throw new IllegalArgumentException("Cannot lookup target method for %s in class %s; This appears to be a bug" .formatted(method, targetClass.getName())); } diff --git a/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java b/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java index 61236c399..f03b0c27e 100644 --- a/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java @@ -60,7 +60,7 @@ public interface BoundValueOperations extends BoundKeyOperations { */ default void set(V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { set(value, timeout.toMillis(), TimeUnit.MILLISECONDS); @@ -105,7 +105,7 @@ public interface BoundValueOperations extends BoundKeyOperations { @Nullable default Boolean setIfAbsent(V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { return setIfAbsent(value, timeout.toMillis(), TimeUnit.MILLISECONDS); @@ -153,7 +153,7 @@ public interface BoundValueOperations extends BoundKeyOperations { @Nullable default Boolean setIfPresent(V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { return setIfPresent(value, timeout.toMillis(), TimeUnit.MILLISECONDS); diff --git a/src/main/java/org/springframework/data/redis/core/ConvertingCursor.java b/src/main/java/org/springframework/data/redis/core/ConvertingCursor.java index 191ead24f..faeac66e3 100644 --- a/src/main/java/org/springframework/data/redis/core/ConvertingCursor.java +++ b/src/main/java/org/springframework/data/redis/core/ConvertingCursor.java @@ -40,8 +40,8 @@ public class ConvertingCursor implements Cursor { */ public ConvertingCursor(Cursor cursor, Converter converter) { - Assert.notNull(cursor, "Cursor delegate must not be 'null'."); - Assert.notNull(cursor, "Converter must not be 'null'."); + Assert.notNull(cursor, "Cursor delegate must not be 'null'"); + Assert.notNull(cursor, "Converter must not be 'null'"); this.delegate = cursor; this.converter = converter; } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java index dd1ce8a8f..076ddf4d3 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java @@ -55,7 +55,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public Set keys(RedisClusterNode node, K pattern) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); return doInCluster(connection -> deserializeKeys(connection.keys(node, rawKey(pattern)))); } @@ -63,7 +63,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public K randomKey(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); return doInCluster(connection -> deserializeKey(connection.randomKey(node))); } @@ -71,7 +71,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public String ping(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); return doInCluster(connection -> connection.ping(node)); } @@ -79,7 +79,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void addSlots(RedisClusterNode node, int... slots) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.clusterAddSlots(node, slots); @@ -90,8 +90,8 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void addSlots(RedisClusterNode node, SlotRange range) { - Assert.notNull(node, "ClusterNode must not be null."); - Assert.notNull(range, "Range must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); + Assert.notNull(range, "Range must not be null"); addSlots(node, range.getSlotsArray()); } @@ -99,7 +99,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void bgReWriteAof(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.bgReWriteAof(node); @@ -110,7 +110,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void bgSave(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.bgSave(node); @@ -121,7 +121,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void meet(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.clusterMeet(node); @@ -132,7 +132,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void forget(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.clusterForget(node); @@ -143,7 +143,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void flushDb(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.flushDb(node); @@ -154,7 +154,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void flushDb(RedisClusterNode node, FlushOption option) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.flushDb(node, option); @@ -165,7 +165,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public Collection getReplicas(final RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); return doInCluster(connection -> connection.clusterGetReplicas(node)); } @@ -173,7 +173,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void save(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.save(node); @@ -184,7 +184,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void shutdown(RedisClusterNode node) { - Assert.notNull(node, "ClusterNode must not be null."); + Assert.notNull(node, "ClusterNode must not be null"); doInCluster((RedisClusterCallback) connection -> { connection.shutdown(node); @@ -195,8 +195,8 @@ class DefaultClusterOperations extends AbstractOperations implements @Override public void reshard(RedisClusterNode source, int slot, RedisClusterNode target) { - Assert.notNull(source, "Source node must not be null."); - Assert.notNull(target, "Target node must not be null."); + Assert.notNull(source, "Source node must not be null"); + Assert.notNull(target, "Target node must not be null"); doInCluster((RedisClusterCallback) connection -> { @@ -221,7 +221,7 @@ class DefaultClusterOperations extends AbstractOperations implements @Nullable T doInCluster(RedisClusterCallback callback) { - Assert.notNull(callback, "ClusterCallback must not be null!"); + Assert.notNull(callback, "ClusterCallback must not be null"); try (RedisClusterConnection connection = template.getConnectionFactory().getClusterConnection()) { return callback.doInRedis(connection); diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveGeoOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveGeoOperations.java index 79aa6b7aa..b41e19fdd 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveGeoOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveGeoOperations.java @@ -64,9 +64,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono add(K key, Point point, V member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(point, "Point must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(point, "Point must not be null"); + Assert.notNull(member, "Member must not be null"); return createMono(connection -> connection.geoAdd(rawKey(key), point, rawValue(member))); } @@ -74,8 +74,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono add(K key, GeoLocation location) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(location, "GeoLocation must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(location, "GeoLocation must not be null"); return createMono(connection -> connection.geoAdd(rawKey(key), new GeoLocation<>(rawValue(location.getName()), location.getPoint()))); @@ -84,8 +84,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono add(K key, Map memberCoordinateMap) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null"); return createMono(connection -> { @@ -100,8 +100,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono add(K key, Iterable> geoLocations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(geoLocations, "GeoLocations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(geoLocations, "GeoLocations must not be null"); return createMono(connection -> { @@ -115,8 +115,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux add(K key, Publisher>> locations) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(locations, "Locations must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(locations, "Locations must not be null"); return createFlux(connection -> Flux.from(locations) .map(locationList -> locationList.stream() @@ -128,9 +128,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono distance(K key, V member1, V member2) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member 1 must not be null!"); - Assert.notNull(member2, "Member 2 must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member 1 must not be null"); + Assert.notNull(member2, "Member 2 must not be null"); return createMono(connection -> connection.geoDist(rawKey(key), rawValue(member1), rawValue(member2))); } @@ -138,10 +138,10 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono distance(K key, V member1, V member2, Metric metric) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member1, "Member 1 must not be null!"); - Assert.notNull(member2, "Member 2 must not be null!"); - Assert.notNull(metric, "Metric must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member1, "Member 1 must not be null"); + Assert.notNull(member2, "Member 2 must not be null"); + Assert.notNull(metric, "Metric must not be null"); return createMono(connection -> connection.geoDist(rawKey(key), rawValue(member1), rawValue(member2), metric)); } @@ -149,8 +149,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono hash(K key, V member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); return createMono(connection -> connection.geoHash(rawKey(key), rawValue(member))); } @@ -159,9 +159,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @SafeVarargs public final Mono> hash(K key, V... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(members, "Members must not be null or empty!"); - Assert.noNullElements(members, "Members must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(members, "Members must not be null or empty"); + Assert.noNullElements(members, "Members must not contain null elements"); return createMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // @@ -172,8 +172,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono position(K key, V member) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); return createMono(connection -> connection.geoPos(rawKey(key), rawValue(member))); } @@ -182,9 +182,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @SafeVarargs public final Mono> position(K key, V... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(members, "Members must not be null or empty!"); - Assert.noNullElements(members, "Members must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(members, "Members must not be null or empty"); + Assert.noNullElements(members, "Members must not contain null elements"); return createMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // @@ -195,8 +195,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux>> radius(K key, Circle within) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Circle must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Circle must not be null"); return createFlux(connection -> connection.geoRadius(rawKey(key), within).map(this::readGeoResult)); } @@ -204,9 +204,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux>> radius(K key, Circle within, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(within, "Circle must not be null!"); - Assert.notNull(args, "GeoRadiusCommandArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(within, "Circle must not be null"); + Assert.notNull(args, "GeoRadiusCommandArgs must not be null"); return createFlux(connection -> connection.geoRadius(rawKey(key), within, args) // .map(this::readGeoResult)); @@ -215,8 +215,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux>> radius(K key, V member, double radius) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); return createFlux(connection -> connection.geoRadiusByMember(rawKey(key), rawValue(member), new Distance(radius)) // .map(this::readGeoResult)); @@ -225,9 +225,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux>> radius(K key, V member, Distance distance) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(distance, "Distance must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(distance, "Distance must not be null"); return createFlux(connection -> connection.geoRadiusByMember(rawKey(key), rawValue(member), distance) // .map(this::readGeoResult)); @@ -236,10 +236,10 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Flux>> radius(K key, V member, Distance distance, GeoRadiusCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(member, "Member must not be null!"); - Assert.notNull(distance, "Distance must not be null!"); - Assert.notNull(args, "GeoRadiusCommandArgs must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(member, "Member must not be null"); + Assert.notNull(distance, "Distance must not be null"); + Assert.notNull(args, "GeoRadiusCommandArgs must not be null"); return createFlux(connection -> connection.geoRadiusByMember(rawKey(key), rawValue(member), distance, args)) .map(this::readGeoResult); @@ -249,9 +249,9 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @SafeVarargs public final Mono remove(K key, V... members) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(members, "Members must not be null or empty!"); - Assert.noNullElements(members, "Members must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(members, "Members must not be null or empty"); + Assert.noNullElements(members, "Members must not contain null elements"); return template.doCreateMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // @@ -262,7 +262,7 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations @Override public Mono delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } @@ -271,8 +271,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations public Flux>> search(K key, GeoReference reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(reference, "GeoReference must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(reference, "GeoReference must not be null"); GeoReference rawReference = getGeoReference(reference); return template.doCreateFlux(connection -> connection.geoCommands() @@ -283,8 +283,8 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations public Mono searchAndStore(K key, K destKey, GeoReference reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(reference, "GeoReference must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(reference, "GeoReference must not be null"); GeoReference rawReference = getGeoReference(reference); return template.doCreateMono(connection -> connection.geoCommands().geoSearchStore(rawKey(destKey), rawKey(key), @@ -293,14 +293,14 @@ class DefaultReactiveGeoOperations implements ReactiveGeoOperations private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.geoCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.geoCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveHashOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveHashOperations.java index 6d41a8b27..c519527d3 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveHashOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveHashOperations.java @@ -55,10 +55,10 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @SuppressWarnings("unchecked") public Mono remove(H key, Object... hashKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKeys, "Hash keys must not be null!"); - Assert.notEmpty(hashKeys, "Hash keys must not be empty!"); - Assert.noNullElements(hashKeys, "Hash keys must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKeys, "Hash keys must not be null"); + Assert.notEmpty(hashKeys, "Hash keys must not be empty"); + Assert.noNullElements(hashKeys, "Hash keys must not contain null elements"); return createMono(connection -> Flux.fromArray(hashKeys) // .map(o -> (HK) o).map(this::rawHashKey) // @@ -70,8 +70,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @SuppressWarnings("unchecked") public Mono hasKey(H key, Object hashKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); return createMono(connection -> connection.hExists(rawKey(key), rawHashKey((HK) hashKey))); } @@ -80,8 +80,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @SuppressWarnings("unchecked") public Mono get(H key, Object hashKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); return createMono(connection -> connection.hGet(rawKey(key), rawHashKey((HK) hashKey)).map(this::readHashValue)); } @@ -89,9 +89,9 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono> multiGet(H key, Collection hashKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKeys, "Hash keys must not be null!"); - Assert.notEmpty(hashKeys, "Hash keys must not be empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKeys, "Hash keys must not be null"); + Assert.notEmpty(hashKeys, "Hash keys must not be empty"); return createMono(connection -> Flux.fromIterable(hashKeys) // .map(this::rawHashKey) // @@ -102,8 +102,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono increment(H key, HK hashKey, long delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); return template.doCreateMono(connection -> connection // .numberCommands() // @@ -113,8 +113,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono increment(H key, HK hashKey, double delta) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); return template.doCreateMono(connection -> connection // .numberCommands() // @@ -124,7 +124,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono randomKey(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection // .hashCommands().hRandField(rawKey(key))).map(this::readHashKey); @@ -133,7 +133,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono> randomEntry(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection // .hashCommands().hRandFieldWithValues(rawKey(key))).map(this::deserializeHashEntry); @@ -142,7 +142,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux randomKeys(H key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateFlux(connection -> connection // .hashCommands().hRandField(rawKey(key), count)).map(this::readHashKey); @@ -151,7 +151,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux> randomEntries(H key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateFlux(connection -> connection // .hashCommands().hRandFieldWithValues(rawKey(key), count)).map(this::deserializeHashEntry); @@ -160,7 +160,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux keys(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.hKeys(rawKey(key)) // .map(this::readHashKey)); @@ -169,7 +169,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono size(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.hLen(rawKey(key))); } @@ -177,8 +177,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono putAll(H key, Map map) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(map, "Map must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(map, "Map must not be null"); return createMono(connection -> Flux.fromIterable(() -> map.entrySet().iterator()) // .collectMap(entry -> rawHashKey(entry.getKey()), entry -> rawHashValue(entry.getValue())) // @@ -188,9 +188,9 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono put(H key, HK hashKey, HV value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); - Assert.notNull(value, "Hash value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); + Assert.notNull(value, "Hash value must not be null"); return createMono(connection -> connection.hSet(rawKey(key), rawHashKey(hashKey), rawHashValue(value))); } @@ -198,9 +198,9 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono putIfAbsent(H key, HK hashKey, HV value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(hashKey, "Hash key must not be null!"); - Assert.notNull(value, "Hash value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(hashKey, "Hash key must not be null"); + Assert.notNull(value, "Hash value must not be null"); return createMono(connection -> connection.hSetNX(rawKey(key), rawHashKey(hashKey), rawHashValue(value))); } @@ -208,7 +208,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux values(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.hVals(rawKey(key)) // .map(this::readHashValue)); @@ -217,7 +217,7 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux> entries(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.hGetAll(rawKey(key)) // .map(this::deserializeHashEntry)); @@ -226,8 +226,8 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Flux> scan(H key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(key, "ScanOptions must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(key, "ScanOptions must not be null"); return createFlux(connection -> connection.hScan(rawKey(key), options) // .map(this::deserializeHashEntry)); @@ -236,21 +236,21 @@ class DefaultReactiveHashOperations implements ReactiveHashOperations @Override public Mono delete(H key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.hashCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.hashCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveHyperLogLogOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveHyperLogLogOperations.java index 2a2d0d6e6..8e80be0e4 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveHyperLogLogOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveHyperLogLogOperations.java @@ -49,9 +49,9 @@ class DefaultReactiveHyperLogLogOperations implements ReactiveHyperLogLogO @SafeVarargs public final Mono add(K key, V... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(values, "Values must not be null or empty!"); - Assert.noNullElements(values, "Values must not contain null elements!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(values, "Values must not be null or empty"); + Assert.noNullElements(values, "Values must not contain null elements"); return createMono(connection -> Flux.fromArray(values) // .map(this::rawValue) // @@ -63,8 +63,8 @@ class DefaultReactiveHyperLogLogOperations implements ReactiveHyperLogLogO @SafeVarargs public final Mono size(K... keys) { - Assert.notEmpty(keys, "Keys must not be null or empty!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notEmpty(keys, "Keys must not be null or empty"); + Assert.noNullElements(keys, "Keys must not contain null elements"); return createMono(connection -> Flux.fromArray(keys) // .map(this::rawKey) // @@ -76,9 +76,9 @@ class DefaultReactiveHyperLogLogOperations implements ReactiveHyperLogLogO @SafeVarargs public final Mono union(K destination, K... sourceKeys) { - Assert.notNull(destination, "Destination key must not be null!"); - Assert.notEmpty(sourceKeys, "Source keys must not be null or empty!"); - Assert.noNullElements(sourceKeys, "Source keys must not contain null elements!"); + Assert.notNull(destination, "Destination key must not be null"); + Assert.notEmpty(sourceKeys, "Source keys must not be null or empty"); + Assert.noNullElements(sourceKeys, "Source keys must not contain null elements"); return createMono(connection -> Flux.fromArray(sourceKeys) // .map(this::rawKey) // @@ -89,14 +89,14 @@ class DefaultReactiveHyperLogLogOperations implements ReactiveHyperLogLogO @Override public Mono delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.hyperLogLogCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveListOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveListOperations.java index 29de9abe6..d73afc417 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveListOperations.java @@ -56,7 +56,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations range(K key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.lRange(rawKey(key), start, end).map(this::readValue)); } @@ -64,7 +64,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations trim(K key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lTrim(rawKey(key), start, end)); } @@ -72,7 +72,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations size(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lLen(rawKey(key))); } @@ -86,7 +86,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPushAll(K key, V... values) { - Assert.notEmpty(values, "Values must not be null or empty!"); + Assert.notEmpty(values, "Values must not be null or empty"); return leftPushAll(key, Arrays.asList(values)); } @@ -94,8 +94,8 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPushAll(K key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(values, "Values must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(values, "Values must not be null or empty"); return createMono(connection -> Flux.fromIterable(values) // .map(this::rawValue) // @@ -106,7 +106,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPushIfPresent(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lPushX(rawKey(key), rawValue(value))); } @@ -114,7 +114,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPush(K key, V pivot, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lInsert(rawKey(key), Position.BEFORE, rawValue(pivot), rawValue(value))); } @@ -128,7 +128,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPushAll(K key, V... values) { - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(values, "Values must not be null"); return rightPushAll(key, Arrays.asList(values)); } @@ -136,8 +136,8 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPushAll(K key, Collection values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notEmpty(values, "Values must not be null or empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.notEmpty(values, "Values must not be null or empty"); return createMono(connection -> Flux.fromIterable(values) // .map(this::rawValue) // @@ -148,7 +148,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPushIfPresent(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.rPushX(rawKey(key), rawValue(value))); } @@ -156,7 +156,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPush(K key, V pivot, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lInsert(rawKey(key), Position.AFTER, rawValue(pivot), rawValue(value))); } @@ -164,10 +164,10 @@ class DefaultReactiveListOperations implements ReactiveListOperations move(K sourceKey, Direction from, K destinationKey, Direction to) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); return createMono( connection -> connection.lMove(rawKey(sourceKey), rawKey(destinationKey), from, to).map(this::readValue)); @@ -176,11 +176,11 @@ class DefaultReactiveListOperations implements ReactiveListOperations move(K sourceKey, Direction from, K destinationKey, Direction to, Duration timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(from, "From direction must not be null!"); - Assert.notNull(to, "To direction must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(from, "From direction must not be null"); + Assert.notNull(to, "To direction must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return createMono(connection -> connection.bLMove(rawKey(sourceKey), rawKey(destinationKey), from, to, timeout) .map(this::readValue)); @@ -189,7 +189,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations set(K key, long index, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lSet(rawKey(key), index, rawValue(value))); } @@ -198,7 +198,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations remove(K key, long count, Object value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lRem(rawKey(key), count, rawValue((V) value))); } @@ -206,7 +206,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations index(K key, long index) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lIndex(rawKey(key), index).map(this::readValue)); } @@ -214,7 +214,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations indexOf(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lPos(rawKey(key), rawValue(value))); } @@ -222,7 +222,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations lastIndexOf(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lPos(LPosCommand.lPosOf(rawValue(value)).from(rawKey(key)).rank(-1))); } @@ -230,7 +230,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPop(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.lPop(rawKey(key)).map(this::readValue)); @@ -239,9 +239,9 @@ class DefaultReactiveListOperations implements ReactiveListOperations leftPop(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); - Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); + Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second"); return createMono(connection -> connection.blPop(Collections.singletonList(rawKey(key)), timeout) .map(popResult -> readValue(popResult.getValue()))); @@ -250,7 +250,7 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPop(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.rPop(rawKey(key)).map(this::readValue)); } @@ -258,9 +258,9 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPop(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); - Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); + Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second"); return createMono(connection -> connection.brPop(Collections.singletonList(rawKey(key)), timeout) .map(popResult -> readValue(popResult.getValue()))); @@ -269,8 +269,8 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPopAndLeftPush(K sourceKey, K destinationKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); return createMono( connection -> connection.rPopLPush(rawKey(sourceKey), rawKey(destinationKey)).map(this::readValue)); @@ -279,10 +279,10 @@ class DefaultReactiveListOperations implements ReactiveListOperations rightPopAndLeftPush(K sourceKey, K destinationKey, Duration timeout) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destinationKey, "Destination key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); - Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destinationKey, "Destination key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); + Assert.isTrue(isZeroOrGreater1Second(timeout), "Duration must be either zero or greater or equal to 1 second"); return createMono( connection -> connection.bRPopLPush(rawKey(sourceKey), rawKey(destinationKey), timeout).map(this::readValue)); @@ -291,21 +291,21 @@ class DefaultReactiveListOperations implements ReactiveListOperations delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.listCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.listCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveSetOperations.java index db7c7537c..081b2ce87 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveSetOperations.java @@ -55,7 +55,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono add(K key, V... values) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (values.length == 1) { return createMono(connection -> connection.sAdd(rawKey(key), rawValue(values[0]))); @@ -71,7 +71,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @SuppressWarnings("unchecked") public Mono remove(K key, Object... values) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (values.length == 1) { return createMono(connection -> connection.sRem(rawKey(key), rawValue((V) values[0]))); @@ -86,7 +86,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono pop(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.sPop(rawKey(key)).map(this::readValue)); } @@ -94,7 +94,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux pop(K key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.sPop(rawKey(key), count).map(this::readValue)); } @@ -102,8 +102,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono move(K sourceKey, V value, K destKey) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> connection.sMove(rawKey(sourceKey), rawKey(destKey), rawValue(value))); } @@ -111,7 +111,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono size(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.sCard(rawKey(key))); } @@ -120,7 +120,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @SuppressWarnings("unchecked") public Mono isMember(K key, Object o) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.sIsMember(rawKey(key), rawValue((V) o))); } @@ -128,7 +128,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono> isMember(K key, Object... objects) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> { @@ -152,8 +152,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux intersect(K key, K otherKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); return intersect(key, Collections.singleton(otherKey)); } @@ -161,8 +161,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux intersect(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return intersect(getKeys(key, otherKeys)); } @@ -170,7 +170,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux intersect(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return createFlux(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -182,9 +182,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono intersectAndStore(K key, K otherKey, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return intersectAndStore(key, Collections.singleton(otherKey), destKey); } @@ -192,9 +192,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono intersectAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return intersectAndStore(getKeys(key, otherKeys), destKey); } @@ -202,8 +202,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono intersectAndStore(Collection keys, K destKey) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -214,8 +214,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux union(K key, K otherKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); return union(key, Collections.singleton(otherKey)); } @@ -223,8 +223,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux union(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return union(getKeys(key, otherKeys)); } @@ -232,7 +232,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux union(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return createFlux(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -244,9 +244,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono unionAndStore(K key, K otherKey, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return unionAndStore(key, Collections.singleton(otherKey), destKey); } @@ -254,9 +254,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono unionAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return unionAndStore(getKeys(key, otherKeys), destKey); } @@ -264,8 +264,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono unionAndStore(Collection keys, K destKey) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -276,8 +276,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux difference(K key, K otherKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); return difference(key, Collections.singleton(otherKey)); } @@ -285,8 +285,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux difference(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return difference(getKeys(key, otherKeys)); } @@ -294,7 +294,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux difference(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return createFlux(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -306,9 +306,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono differenceAndStore(K key, K otherKey, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return differenceAndStore(key, Collections.singleton(otherKey), destKey); } @@ -316,9 +316,9 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono differenceAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return differenceAndStore(getKeys(key, otherKeys), destKey); } @@ -326,8 +326,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono differenceAndStore(Collection keys, K destKey) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(keys) // .map(this::rawKey) // @@ -338,7 +338,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux members(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.sMembers(rawKey(key)).map(this::readValue)); } @@ -346,8 +346,8 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux scan(K key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(options, "ScanOptions must not be null"); return createFlux(connection -> connection.sScan(rawKey(key), options).map(this::readValue)); } @@ -355,7 +355,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono randomMember(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.sRandMember(rawKey(key)).map(this::readValue)); } @@ -363,7 +363,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux distinctRandomMembers(K key, long count) { - Assert.isTrue(count > 0, "Negative count not supported. Use randomMembers to allow duplicate elements."); + Assert.isTrue(count > 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); return createFlux(connection -> connection.sRandMember(rawKey(key), count).map(this::readValue)); } @@ -371,7 +371,7 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Flux randomMembers(K key, long count) { - Assert.isTrue(count > 0, "Use a positive number for count. This method is already allowing duplicate elements."); + Assert.isTrue(count > 0, "Use a positive number for count; This method is already allowing duplicate elements"); return createFlux(connection -> connection.sRandMember(rawKey(key), -count).map(this::readValue)); } @@ -379,21 +379,21 @@ class DefaultReactiveSetOperations implements ReactiveSetOperations @Override public Mono delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.setCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.setCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveStreamOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveStreamOperations.java index 9cf9e65ba..f0ef94062 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveStreamOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveStreamOperations.java @@ -122,10 +122,10 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono acknowledge(K key, String group, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.hasText(group, "Group must not be null or empty!"); - Assert.notNull(recordIds, "MessageIds must not be null!"); - Assert.notEmpty(recordIds, "MessageIds must not be empty!"); + Assert.notNull(key, "Key must not be null"); + Assert.hasText(group, "Group must not be null or empty"); + Assert.notNull(recordIds, "MessageIds must not be null"); + Assert.notEmpty(recordIds, "MessageIds must not be empty"); return createMono(connection -> connection.xAck(rawKey(key), group, recordIds)); } @@ -133,8 +133,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono add(Record record) { - Assert.notNull(record.getStream(), "Key must not be null!"); - Assert.notNull(record.getValue(), "Body must not be null!"); + Assert.notNull(record.getStream(), "Key must not be null"); + Assert.notNull(record.getValue(), "Body must not be null"); MapRecord input = StreamObjectMapper.toMapRecord(this, record); @@ -144,8 +144,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono delete(K key, RecordId... recordIds) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(recordIds, "MessageIds must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(recordIds, "MessageIds must not be null"); return createMono(connection -> connection.xDel(rawKey(key), recordIds)); } @@ -153,9 +153,9 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono createGroup(K key, ReadOffset readOffset, String group) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(readOffset, "ReadOffset must not be null!"); - Assert.notNull(group, "Group must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(readOffset, "ReadOffset must not be null"); + Assert.notNull(group, "Group must not be null"); return createMono(connection -> connection.xGroupCreate(rawKey(key), group, readOffset, true)); } @@ -163,8 +163,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono deleteConsumer(K key, Consumer consumer) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(consumer, "Consumer must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(consumer, "Consumer must not be null"); return createMono(connection -> connection.xGroupDelConsumer(rawKey(key), consumer)); } @@ -172,8 +172,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono destroyGroup(K key, String group) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); return createMono(connection -> connection.xGroupDestroy(rawKey(key), group)); } @@ -181,8 +181,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux consumers(K key, String group) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(group, "Group must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(group, "Group must not be null"); return createFlux(connection -> connection.xInfoConsumers(rawKey(key), group)); } @@ -190,7 +190,7 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono info(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.xInfo(rawKey(key))); } @@ -198,7 +198,7 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux groups(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.xInfoGroups(rawKey(key))); } @@ -227,7 +227,7 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono size(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.xLen(rawKey(key))); } @@ -235,9 +235,9 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux> range(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux(connection -> connection.xRange(rawKey(key), range, limit).map(this::deserializeRecord)); } @@ -245,8 +245,8 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux> read(StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "Streams must not be null!"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "Streams must not be null"); return createFlux(connection -> { @@ -259,9 +259,9 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux> read(Consumer consumer, StreamReadOptions readOptions, StreamOffset... streams) { - Assert.notNull(consumer, "Consumer must not be null!"); - Assert.notNull(readOptions, "StreamReadOptions must not be null!"); - Assert.notNull(streams, "Streams must not be null!"); + Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(readOptions, "StreamReadOptions must not be null"); + Assert.notNull(streams, "Streams must not be null"); return createFlux(connection -> { @@ -274,9 +274,9 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Flux> reverseRange(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux(connection -> connection.xRevRange(rawKey(key), range, limit).map(this::deserializeRecord)); } @@ -288,7 +288,7 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat @Override public Mono trim(K key, long count, boolean approximateTrimming) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.xTrim(rawKey(key), count, approximateTrimming)); } @@ -307,14 +307,14 @@ class DefaultReactiveStreamOperations implements ReactiveStreamOperat private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.streamCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.streamCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveValueOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveValueOperations.java index d101f8218..3ebb3a147 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveValueOperations.java @@ -58,7 +58,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations set(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.set(rawKey(key), rawValue(value))); } @@ -66,8 +66,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations set(K key, V value, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); return createMono( connection -> connection.set(rawKey(key), rawValue(value), Expiration.from(timeout), SetOption.UPSERT)); @@ -76,7 +76,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations setIfAbsent(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono( connection -> connection.set(rawKey(key), rawValue(value), Expiration.persistent(), SetOption.SET_IF_ABSENT)); @@ -85,8 +85,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations setIfAbsent(K key, V value, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); return createMono( connection -> connection.set(rawKey(key), rawValue(value), Expiration.from(timeout), SetOption.SET_IF_ABSENT)); @@ -95,7 +95,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations setIfPresent(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono( connection -> connection.set(rawKey(key), rawValue(value), Expiration.persistent(), SetOption.SET_IF_PRESENT)); @@ -104,8 +104,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations setIfPresent(K key, V value, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Duration must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Duration must not be null"); return createMono( connection -> connection.set(rawKey(key), rawValue(value), Expiration.from(timeout), SetOption.SET_IF_PRESENT)); @@ -114,7 +114,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations multiSet(Map map) { - Assert.notNull(map, "Map must not be null!"); + Assert.notNull(map, "Map must not be null"); return createMono(connection -> { @@ -128,7 +128,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations multiSetIfAbsent(Map map) { - Assert.notNull(map, "Map must not be null!"); + Assert.notNull(map, "Map must not be null"); return createMono(connection -> { @@ -143,7 +143,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations get(Object key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.get(rawKey((K) key)) // .map(this::readValue)); @@ -152,7 +152,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations getAndDelete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.getDel(rawKey(key)) // .map(this::readValue)); @@ -161,8 +161,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations getAndExpire(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return createMono(connection -> connection.getEx(rawKey(key), Expiration.from(timeout)) // .map(this::readValue)); @@ -171,7 +171,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations getAndPersist(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.getEx(rawKey(key), Expiration.persistent()) // .map(this::readValue)); @@ -180,7 +180,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations getAndSet(K key, V value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.getSet(rawKey(key), rawValue(value)).map(value()::read)); } @@ -188,7 +188,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations> multiGet(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return createMono(connection -> Flux.fromIterable(keys).map(key()::write).collectList().flatMap(connection::mGet) .map(this::deserializeValues)); @@ -197,7 +197,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations increment(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.numberCommands().incr(rawKey(key))); } @@ -205,7 +205,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations increment(K key, long delta) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.numberCommands().incrBy(rawKey(key), delta)); } @@ -213,7 +213,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations increment(K key, double delta) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.numberCommands().incrBy(rawKey(key), delta)); } @@ -221,7 +221,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations decrement(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.numberCommands().decr(rawKey(key))); } @@ -229,7 +229,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations decrement(K key, long delta) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.numberCommands().decrBy(rawKey(key), delta)); } @@ -237,8 +237,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations append(K key, String value) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(value, "Value must not be null"); return createMono( connection -> connection.append(rawKey(key), serializationContext.getStringSerializationPair().write(value))); @@ -247,7 +247,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations get(K key, long start, long end) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.getRange(rawKey(key), start, end) // .map(stringSerializationPair()::read)); @@ -256,7 +256,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations set(K key, V value, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.setRange(rawKey(key), rawValue(value), offset)); } @@ -264,7 +264,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations size(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.strLen(rawKey(key))); } @@ -272,7 +272,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations setBit(K key, long offset, boolean value) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.setBit(rawKey(key), offset, value)); } @@ -280,7 +280,7 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations getBit(K key, long offset) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.getBit(rawKey(key), offset)); } @@ -288,8 +288,8 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations> bitField(K key, BitFieldSubCommands subCommands) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(subCommands, "BitFieldSubCommands must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(subCommands, "BitFieldSubCommands must not be null"); return createMono(connection -> connection.bitField(rawKey(key), subCommands)); } @@ -297,14 +297,14 @@ class DefaultReactiveValueOperations implements ReactiveValueOperations delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.stringCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultReactiveZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultReactiveZSetOperations.java index 4d5b98cfb..5dfd9dfdf 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultReactiveZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultReactiveZSetOperations.java @@ -63,7 +63,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations add(K key, V value, double score) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zAdd(rawKey(key), score, rawValue(value)).map(l -> l != 0)); } @@ -71,8 +71,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations addAll(K key, Collection> tuples) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(tuples, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(tuples, "Key must not be null"); return createMono(connection -> Flux.fromIterable(tuples) // .map(t -> new DefaultTuple(ByteUtils.getBytes(rawValue(t.getValue())), t.getScore())) // @@ -84,8 +84,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations remove(K key, Object... values) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(values, "Values must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(values, "Values must not be null"); if (values.length == 1) { return createMono(connection -> connection.zRem(rawKey(key), rawValue((V) values[0]))); @@ -100,7 +100,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations incrementScore(K key, V value, double delta) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zIncrBy(rawKey(key), delta, rawValue(value))); } @@ -108,7 +108,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations randomMember(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zRandMember(rawKey(key))).map(this::readValue); } @@ -116,8 +116,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations distinctRandomMembers(K key, long count) { - Assert.notNull(key, "Key must not be null!"); - Assert.isTrue(count > 0, "Negative count not supported. Use randomMembers to allow duplicate elements."); + Assert.notNull(key, "Key must not be null"); + Assert.isTrue(count > 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); return createFlux(connection -> connection.zRandMember(rawKey(key), count)).map(this::readValue); } @@ -125,8 +125,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations randomMembers(K key, long count) { - Assert.notNull(key, "Key must not be null!"); - Assert.isTrue(count > 0, "Use a positive number for count. This method is already allowing duplicate elements."); + Assert.notNull(key, "Key must not be null"); + Assert.isTrue(count > 0, "Use a positive number for count; This method is already allowing duplicate elements"); return createFlux(connection -> connection.zRandMember(rawKey(key), -count)).map(this::readValue); } @@ -134,7 +134,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> randomMemberWithScore(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zRandMemberWithScore(rawKey(key))).map(this::readTypedTuple); } @@ -142,8 +142,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> distinctRandomMembersWithScore(K key, long count) { - Assert.notNull(key, "Key must not be null!"); - Assert.isTrue(count > 0, "Negative count not supported. Use randomMembers to allow duplicate elements."); + Assert.notNull(key, "Key must not be null"); + Assert.isTrue(count > 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); return createFlux(connection -> connection.zRandMemberWithScore(rawKey(key), count)).map(this::readTypedTuple); } @@ -151,8 +151,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> randomMembersWithScore(K key, long count) { - Assert.notNull(key, "Key must not be null!"); - Assert.isTrue(count > 0, "Use a positive number for count. This method is already allowing duplicate elements."); + Assert.notNull(key, "Key must not be null"); + Assert.isTrue(count > 0, "Use a positive number for count; This method is already allowing duplicate elements"); return createFlux(connection -> connection.zRandMemberWithScore(rawKey(key), -count)).map(this::readTypedTuple); } @@ -161,7 +161,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations rank(K key, Object o) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zRank(rawKey(key), rawValue((V) o))); } @@ -170,7 +170,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRank(K key, Object o) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zRevRank(rawKey(key), rawValue((V) o))); } @@ -178,8 +178,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations range(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRange(rawKey(key), range).map(this::readValue)); } @@ -187,8 +187,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> rangeWithScores(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRangeWithScores(rawKey(key), range).map(this::readTypedTuple)); } @@ -196,8 +196,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations rangeByScore(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRangeByScore(rawKey(key), range).map(this::readValue)); } @@ -205,8 +205,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> rangeByScoreWithScores(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRangeByScoreWithScores(rawKey(key), range).map(this::readTypedTuple)); } @@ -214,8 +214,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations rangeByScore(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRangeByScore(rawKey(key), range, limit).map(this::readValue)); } @@ -223,9 +223,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> rangeByScoreWithScores(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux( connection -> connection.zRangeByScoreWithScores(rawKey(key), range, limit).map(this::readTypedTuple)); @@ -234,8 +234,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRange(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRevRange(rawKey(key), range).map(this::readValue)); } @@ -243,8 +243,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> reverseRangeWithScores(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRevRangeWithScores(rawKey(key), range).map(this::readTypedTuple)); } @@ -252,8 +252,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRangeByScore(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRevRangeByScore(rawKey(key), range).map(this::readValue)); } @@ -261,8 +261,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> reverseRangeByScoreWithScores(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux( connection -> connection.zRevRangeByScoreWithScores(rawKey(key), range).map(this::readTypedTuple)); @@ -271,8 +271,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRangeByScore(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRevRangeByScore(rawKey(key), range, limit).map(this::readValue)); } @@ -280,9 +280,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> reverseRangeByScoreWithScores(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux( connection -> connection.zRevRangeByScoreWithScores(rawKey(key), range, limit).map(this::readTypedTuple)); @@ -291,8 +291,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> scan(K key, ScanOptions options) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(options, "ScanOptions must not be null"); return createFlux(connection -> connection.zScan(rawKey(key), options).map(this::readTypedTuple)); } @@ -300,8 +300,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations count(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createMono(connection -> connection.zCount(rawKey(key), range)); } @@ -309,8 +309,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations lexCount(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createMono(connection -> connection.zLexCount(rawKey(key), range)); } @@ -318,7 +318,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMin(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zPopMin(rawKey(key)).map(this::readTypedTuple)); } @@ -326,7 +326,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMin(K key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.zPopMin(rawKey(key), count).map(this::readTypedTuple)); } @@ -334,8 +334,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMin(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return createMono(connection -> connection.bZPopMin(rawKey(key), timeout).map(this::readTypedTuple)); } @@ -343,7 +343,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMax(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zPopMax(rawKey(key)).map(this::readTypedTuple)); } @@ -351,7 +351,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMax(K key, long count) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createFlux(connection -> connection.zPopMax(rawKey(key), count).map(this::readTypedTuple)); } @@ -359,8 +359,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> popMax(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); return createMono(connection -> connection.bZPopMax(rawKey(key), timeout).map(this::readTypedTuple)); } @@ -368,7 +368,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations size(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zCard(rawKey(key))); } @@ -377,7 +377,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations score(K key, Object o) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> connection.zScore(rawKey(key), rawValue((V) o))); } @@ -386,7 +386,7 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> score(K key, Object... o) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return createMono(connection -> Flux.fromArray((V[]) o) // .map(this::rawValue) // @@ -397,8 +397,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations removeRange(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createMono(connection -> connection.zRemRangeByRank(rawKey(key), range)); } @@ -406,8 +406,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations removeRangeByLex(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createMono(connection -> connection.zRemRangeByLex(rawKey(key), range)); } @@ -415,8 +415,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations removeRangeByScore(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createMono(connection -> connection.zRemRangeByScore(rawKey(key), range)); } @@ -424,8 +424,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations difference(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -436,8 +436,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> differenceWithScores(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -448,9 +448,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations differenceAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -462,8 +462,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations intersect(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -474,8 +474,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> intersectWithScores(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -488,10 +488,10 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -502,9 +502,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations intersectAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -515,11 +515,11 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations intersectAndStore(K key, Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(aggregate, "Aggregate must not be null!"); - Assert.notNull(weights, "Weights must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(aggregate, "Aggregate must not be null"); + Assert.notNull(weights, "Weights must not be null"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -530,8 +530,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations union(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -542,8 +542,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> unionWithScores(K key, Collection otherKeys) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -554,10 +554,10 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations> unionWithScores(K key, Collection otherKeys, Aggregate aggregate, Weights weights) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(aggregate, "Aggregate must not be null!"); - Assert.notNull(weights, "Weights must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(aggregate, "Aggregate must not be null"); + Assert.notNull(weights, "Weights must not be null"); return createFlux(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -568,9 +568,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations unionAndStore(K key, K otherKey, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKey, "Other key must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKey, "Other key must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return unionAndStore(key, Collections.singleton(otherKey), destKey); } @@ -578,9 +578,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations unionAndStore(K key, Collection otherKeys, K destKey) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -591,11 +591,11 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations unionAndStore(K key, Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(otherKeys, "Other keys must not be null!"); - Assert.notNull(destKey, "Destination key must not be null!"); - Assert.notNull(aggregate, "Aggregate must not be null!"); - Assert.notNull(weights, "Weights must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(otherKeys, "Other keys must not be null"); + Assert.notNull(destKey, "Destination key must not be null"); + Assert.notNull(aggregate, "Aggregate must not be null"); + Assert.notNull(weights, "Weights must not be null"); return createMono(connection -> Flux.fromIterable(getKeys(key, otherKeys)) // .map(this::rawKey) // @@ -606,8 +606,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations rangeByLex(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRangeByLex(rawKey(key), range).map(this::readValue)); } @@ -615,9 +615,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations rangeByLex(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux(connection -> connection.zRangeByLex(rawKey(key), range, limit).map(this::readValue)); } @@ -625,8 +625,8 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRangeByLex(K key, Range range) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); return createFlux(connection -> connection.zRevRangeByLex(rawKey(key), range).map(this::readValue)); } @@ -634,9 +634,9 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations reverseRangeByLex(K key, Range range, Limit limit) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(range, "Range must not be null!"); - Assert.notNull(limit, "Limit must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(range, "Range must not be null"); + Assert.notNull(limit, "Limit must not be null"); return createFlux(connection -> connection.zRevRangeByLex(rawKey(key), range, limit).map(this::readValue)); } @@ -644,21 +644,21 @@ class DefaultReactiveZSetOperations implements ReactiveZSetOperations delete(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return template.doCreateMono(connection -> connection.keyCommands().del(rawKey(key))).map(l -> l != 0); } private Mono createMono(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateMono(connection -> function.apply(connection.zSetCommands())); } private Flux createFlux(Function> function) { - Assert.notNull(function, "Function must not be null!"); + Assert.notNull(function, "Function must not be null"); return template.doCreateFlux(connection -> function.apply(connection.zSetCommands())); } diff --git a/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java index 670172996..91cce51eb 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java @@ -207,7 +207,7 @@ class DefaultSetOperations extends AbstractOperations implements Set @Override public Set distinctRandomMembers(K key, long count) { - Assert.isTrue(count >= 0, "Negative count not supported. " + "Use randomMembers to allow duplicate elements."); + Assert.isTrue(count >= 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); byte[] rawKey = rawKey(key); Set rawValues = execute( @@ -220,7 +220,7 @@ class DefaultSetOperations extends AbstractOperations implements Set public List randomMembers(K key, long count) { Assert.isTrue(count >= 0, - "Use a positive number for count. " + "This method is already allowing duplicate elements."); + "Use a positive number for count; This method is already allowing duplicate elements"); byte[] rawKey = rawKey(key); List rawValues = execute(connection -> connection.sRandMember(rawKey, -count)); diff --git a/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java index f0b4157a5..04ac57029 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java @@ -123,7 +123,7 @@ class DefaultZSetOperations extends AbstractOperations implements ZS @Override public Set distinctRandomMembers(K key, long count) { - Assert.isTrue(count > 0, "Negative count not supported. Use randomMembers to allow duplicate elements."); + Assert.isTrue(count > 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); byte[] rawKey = rawKey(key); @@ -134,7 +134,7 @@ class DefaultZSetOperations extends AbstractOperations implements ZS @Override public List randomMembers(K key, long count) { - Assert.isTrue(count > 0, "Use a positive number for count. This method is already allowing duplicate elements."); + Assert.isTrue(count > 0, "Use a positive number for count; This method is already allowing duplicate elements"); byte[] rawKey = rawKey(key); @@ -153,7 +153,7 @@ class DefaultZSetOperations extends AbstractOperations implements ZS @Override public Set> distinctRandomMembersWithScore(K key, long count) { - Assert.isTrue(count > 0, "Negative count not supported. Use randomMembers to allow duplicate elements."); + Assert.isTrue(count > 0, "Negative count not supported; Use randomMembers to allow duplicate elements"); byte[] rawKey = rawKey(key); @@ -164,7 +164,7 @@ class DefaultZSetOperations extends AbstractOperations implements ZS @Override public List> randomMembersWithScore(K key, long count) { - Assert.isTrue(count > 0, "Use a positive number for count. This method is already allowing duplicate elements."); + Assert.isTrue(count > 0, "Use a positive number for count; This method is already allowing duplicate elements"); byte[] rawKey = rawKey(key); diff --git a/src/main/java/org/springframework/data/redis/core/IndexWriter.java b/src/main/java/org/springframework/data/redis/core/IndexWriter.java index b0a425476..eb34e5b7e 100644 --- a/src/main/java/org/springframework/data/redis/core/IndexWriter.java +++ b/src/main/java/org/springframework/data/redis/core/IndexWriter.java @@ -55,8 +55,8 @@ class IndexWriter { */ public IndexWriter(RedisConnection connection, RedisConverter converter) { - Assert.notNull(connection, "RedisConnection cannot be null!"); - Assert.notNull(converter, "RedisConverter cannot be null!"); + Assert.notNull(connection, "RedisConnection cannot be null"); + Assert.notNull(converter, "RedisConverter cannot be null"); this.connection = connection; this.converter = converter; @@ -95,7 +95,7 @@ class IndexWriter { private void createOrUpdateIndexes(Object key, @Nullable Iterable indexValues, IndexWriteMode writeMode) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); if (indexValues == null) { return; } @@ -124,7 +124,7 @@ class IndexWriter { */ public void removeKeyFromIndexes(String keyspace, Object key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); byte[] binKey = toBytes(key); byte[] indexHelperKey = ByteUtils.concatAll(toBytes(keyspace + ":"), binKey, toBytes(":idx")); @@ -169,7 +169,7 @@ class IndexWriter { */ protected void removeKeyFromExistingIndexes(byte[] key, IndexedData indexedData) { - Assert.notNull(indexedData, "IndexedData must not be null!"); + Assert.notNull(indexedData, "IndexedData must not be null"); Set existingKeys = connection .keys(toBytes(indexedData.getKeyspace() + ":" + indexedData.getIndexName() + ":*")); @@ -201,8 +201,8 @@ class IndexWriter { */ protected void addKeyToIndex(byte[] key, IndexedData indexedData) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(indexedData, "IndexedData must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(indexedData, "IndexedData must not be null"); if (indexedData instanceof RemoveIndexedData) { return; @@ -257,8 +257,8 @@ class IndexWriter { } throw new InvalidDataAccessApiUsageException(String.format( - "Cannot convert %s to binary representation for index key generation. " - + "Are you missing a Converter? Did you register a non PathBasedRedisIndexDefinition that might apply to a complex type?", + "Cannot convert %s to binary representation for index key generation; " + + "Are you missing a Converter; Did you register a non PathBasedRedisIndexDefinition that might apply to a complex type", source.getClass())); } diff --git a/src/main/java/org/springframework/data/redis/core/PartialUpdate.java b/src/main/java/org/springframework/data/redis/core/PartialUpdate.java index c170c1225..6516853c0 100644 --- a/src/main/java/org/springframework/data/redis/core/PartialUpdate.java +++ b/src/main/java/org/springframework/data/redis/core/PartialUpdate.java @@ -60,8 +60,8 @@ public class PartialUpdate { @SuppressWarnings("unchecked") public PartialUpdate(Object id, Class targetType) { - Assert.notNull(id, "Id must not be null!"); - Assert.notNull(targetType, "TargetType must not be null!"); + Assert.notNull(id, "Id must not be null"); + Assert.notNull(targetType, "TargetType must not be null"); this.id = id; this.target = (Class) ClassUtils.getUserClass(targetType); @@ -77,8 +77,8 @@ public class PartialUpdate { @SuppressWarnings("unchecked") public PartialUpdate(Object id, T value) { - Assert.notNull(id, "Id must not be null!"); - Assert.notNull(value, "Value must not be null!"); + Assert.notNull(id, "Id must not be null"); + Assert.notNull(value, "Value must not be null"); this.id = id; this.target = (Class) ClassUtils.getUserClass(value.getClass()); @@ -112,7 +112,7 @@ public class PartialUpdate { */ public PartialUpdate set(String path, Object value) { - Assert.hasText(path, "Path to set must not be null or empty!"); + Assert.hasText(path, "Path to set must not be null or empty"); PartialUpdate update = new PartialUpdate<>(this.id, this.target, this.value, this.refreshTtl, this.propertyUpdates); @@ -129,7 +129,7 @@ public class PartialUpdate { */ public PartialUpdate del(String path) { - Assert.hasText(path, "Path to remove must not be null or empty!"); + Assert.hasText(path, "Path to remove must not be null or empty"); PartialUpdate update = new PartialUpdate<>(this.id, this.target, this.value, this.refreshTtl, this.propertyUpdates); diff --git a/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java b/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java index ff9a69df8..de3573196 100644 --- a/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java @@ -104,7 +104,7 @@ public interface ReactiveRedisOperations { */ default Flux> listenToChannel(String... channels) { - Assert.notNull(channels, "Channels must not be null!"); + Assert.notNull(channels, "Channels must not be null"); return listenTo(Arrays.stream(channels).map(ChannelTopic::of).toArray(ChannelTopic[]::new)); } @@ -119,7 +119,7 @@ public interface ReactiveRedisOperations { */ default Flux> listenToPattern(String... patterns) { - Assert.notNull(patterns, "Patterns must not be null!"); + Assert.notNull(patterns, "Patterns must not be null"); return listenTo(Arrays.stream(patterns).map(PatternTopic::of).toArray(PatternTopic[]::new)); } @@ -144,7 +144,7 @@ public interface ReactiveRedisOperations { */ default Mono>> listenToChannelLater(String... channels) { - Assert.notNull(channels, "Channels must not be null!"); + Assert.notNull(channels, "Channels must not be null"); return listenToLater(Arrays.stream(channels).map(ChannelTopic::of).toArray(ChannelTopic[]::new)); } @@ -160,7 +160,7 @@ public interface ReactiveRedisOperations { */ default Mono>> listenToPatternLater(String... patterns) { - Assert.notNull(patterns, "Patterns must not be null!"); + Assert.notNull(patterns, "Patterns must not be null"); return listenToLater(Arrays.stream(patterns).map(PatternTopic::of).toArray(PatternTopic[]::new)); } diff --git a/src/main/java/org/springframework/data/redis/core/ReactiveRedisTemplate.java b/src/main/java/org/springframework/data/redis/core/ReactiveRedisTemplate.java index 9ce9cf41d..ece9eb6b7 100644 --- a/src/main/java/org/springframework/data/redis/core/ReactiveRedisTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/ReactiveRedisTemplate.java @@ -101,8 +101,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations serializationContext, boolean exposeConnection) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); - Assert.notNull(serializationContext, "SerializationContext must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(serializationContext, "SerializationContext must not be null"); this.connectionFactory = connectionFactory; this.serializationContext = serializationContext; @@ -169,7 +169,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations Flux createFlux(ReactiveRedisCallback callback) { - Assert.notNull(callback, "ReactiveRedisCallback must not be null!"); + Assert.notNull(callback, "ReactiveRedisCallback must not be null"); return Flux.from(doInConnection(callback, exposeConnection)); } @@ -185,7 +185,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations Flux doCreateFlux(ReactiveRedisCallback callback) { - Assert.notNull(callback, "ReactiveRedisCallback must not be null!"); + Assert.notNull(callback, "ReactiveRedisCallback must not be null"); return Flux.from(doInConnection(callback, true)); } @@ -199,7 +199,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations Mono createMono(ReactiveRedisCallback callback) { - Assert.notNull(callback, "ReactiveRedisCallback must not be null!"); + Assert.notNull(callback, "ReactiveRedisCallback must not be null"); return Mono.from(doInConnection(callback, exposeConnection)); } @@ -215,7 +215,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations Mono doCreateMono(ReactiveRedisCallback callback) { - Assert.notNull(callback, "ReactiveRedisCallback must not be null!"); + Assert.notNull(callback, "ReactiveRedisCallback must not be null"); return Mono.from(doInConnection(callback, true)); } @@ -264,8 +264,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations convertAndSend(String destination, V message) { - Assert.hasText(destination, "Destination channel must not be empty!"); - Assert.notNull(message, "Message must not be null!"); + Assert.hasText(destination, "Destination channel must not be empty"); + Assert.notNull(message, "Message must not be null"); return doCreateMono(connection -> connection.pubSubCommands().publish( getSerializationContext().getStringSerializationPair().write(destination), @@ -301,8 +301,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations copy(K sourceKey, K targetKey, boolean replace) { - Assert.notNull(sourceKey, "Source key must not be null!"); - Assert.notNull(targetKey, "Target key must not be null!"); + Assert.notNull(sourceKey, "Source key must not be null"); + Assert.notNull(targetKey, "Target key must not be null"); return doCreateMono(connection -> connection.keyCommands().copy(rawKey(sourceKey), rawKey(targetKey), replace)); } @@ -310,7 +310,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations hasKey(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return doCreateMono(connection -> connection.keyCommands().exists(rawKey(key))); } @@ -318,7 +318,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations type(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return doCreateMono(connection -> connection.keyCommands().type(rawKey(key))); } @@ -326,7 +326,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations keys(K pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); return doCreateFlux(connection -> connection.keyCommands().keys(rawKey(pattern))) // .flatMap(Flux::fromIterable) // @@ -336,7 +336,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations scan(ScanOptions options) { - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(options, "ScanOptions must not be null"); return doCreateFlux(connection -> connection.keyCommands().scan(options)) // .map(this::readKey); @@ -350,8 +350,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations rename(K oldKey, K newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New Key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New Key must not be null"); return doCreateMono(connection -> connection.keyCommands().rename(rawKey(oldKey), rawKey(newKey))); } @@ -359,8 +359,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations renameIfAbsent(K oldKey, K newKey) { - Assert.notNull(oldKey, "Old key must not be null!"); - Assert.notNull(newKey, "New Key must not be null!"); + Assert.notNull(oldKey, "Old key must not be null"); + Assert.notNull(newKey, "New Key must not be null"); return doCreateMono(connection -> connection.keyCommands().renameNX(rawKey(oldKey), rawKey(newKey))); } @@ -369,9 +369,9 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations delete(K... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notEmpty(keys, "Keys must not be empty!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notEmpty(keys, "Keys must not be empty"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (keys.length == 1) { return doCreateMono(connection -> connection.keyCommands().del(rawKey(keys[0]))); @@ -384,7 +384,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations delete(Publisher keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return doCreateFlux(connection -> connection.keyCommands() // .mDel(Flux.from(keys).map(this::rawKey).buffer(128)) // @@ -396,9 +396,9 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations unlink(K... keys) { - Assert.notNull(keys, "Keys must not be null!"); - Assert.notEmpty(keys, "Keys must not be empty!"); - Assert.noNullElements(keys, "Keys must not contain null elements!"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notEmpty(keys, "Keys must not be empty"); + Assert.noNullElements(keys, "Keys must not contain null elements"); if (keys.length == 1) { return doCreateMono(connection -> connection.keyCommands().unlink(rawKey(keys[0]))); @@ -411,7 +411,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations unlink(Publisher keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); return doCreateFlux(connection -> connection.keyCommands() // .mUnlink(Flux.from(keys).map(this::rawKey).buffer(128)) // @@ -422,8 +422,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations expire(K key, Duration timeout) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(timeout, "Timeout must not be null"); if (timeout.getNano() == 0) { return doCreateMono(connection -> connection.keyCommands() // @@ -436,8 +436,8 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations expireAt(K key, Instant expireAt) { - Assert.notNull(key, "Key must not be null!"); - Assert.notNull(expireAt, "Expire at must not be null!"); + Assert.notNull(key, "Key must not be null"); + Assert.notNull(expireAt, "Expire at must not be null"); if (expireAt.getNano() == 0) { return doCreateMono(connection -> connection.keyCommands() // @@ -450,7 +450,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations persist(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return doCreateMono(connection -> connection.keyCommands().persist(rawKey(key))); } @@ -458,7 +458,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations getExpire(K key) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return doCreateMono(connection -> connection.keyCommands().pTtl(rawKey(key)).flatMap(expiry -> { @@ -477,7 +477,7 @@ public class ReactiveRedisTemplate implements ReactiveRedisOperations move(K key, int dbIndex) { - Assert.notNull(key, "Key must not be null!"); + Assert.notNull(key, "Key must not be null"); return doCreateMono(connection -> connection.keyCommands().move(rawKey(key), dbIndex)); } diff --git a/src/main/java/org/springframework/data/redis/core/RedisCommand.java b/src/main/java/org/springframework/data/redis/core/RedisCommand.java index 4e959adaf..2f3a0427a 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisCommand.java +++ b/src/main/java/org/springframework/data/redis/core/RedisCommand.java @@ -344,17 +344,17 @@ public enum RedisCommand { if (requiresExactNumberOfArguments()) { if (nrArguments != maxArgs) { throw new IllegalArgumentException( - String.format("%s command requires %s %s.", this.name(), this.maxArgs, arguments(this.maxArgs))); + String.format("%s command requires %s %s", this.name(), this.maxArgs, arguments(this.maxArgs))); } } if (nrArguments < minArgs) { throw new IllegalArgumentException( - String.format("%s command requires at least %s %s.", this.name(), this.minArgs, arguments(this.maxArgs))); + String.format("%s command requires at least %s %s", this.name(), this.minArgs, arguments(this.maxArgs))); } if (maxArgs > 0 && nrArguments > maxArgs) { throw new IllegalArgumentException( - String.format("%s command requires at most %s %s.", this.name(), this.maxArgs, arguments(this.maxArgs))); + String.format("%s command requires at most %s %s", this.name(), this.maxArgs, arguments(this.maxArgs))); } } } diff --git a/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java index 6970ba0e7..4c78f0486 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java +++ b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java @@ -248,7 +248,7 @@ public abstract class RedisConnectionUtils { if (conHolder.isTransactionActive()) { if (connectionEquals(conHolder, conn)) { if (log.isDebugEnabled()) { - log.debug("RedisConnection will be closed when transaction finished."); + log.debug("RedisConnection will be closed when transaction finished"); } // It's the transactional Connection: Don't close it. @@ -324,12 +324,12 @@ public abstract class RedisConnectionUtils { } if (log.isDebugEnabled()) { - log.debug("Unbinding Redis Connection."); + log.debug("Unbinding Redis Connection"); } if (conHolder.isTransactionActive()) { if (log.isDebugEnabled()) { - log.debug("Redis Connection will be closed when outer transaction finished."); + log.debug("Redis Connection will be closed when outer transaction finished"); } } else { @@ -370,7 +370,7 @@ public abstract class RedisConnectionUtils { } if (log.isDebugEnabled()) { - log.debug("Closing Redis Connection."); + log.debug("Closing Redis Connection"); } try { diff --git a/src/main/java/org/springframework/data/redis/core/RedisKeyValueAdapter.java b/src/main/java/org/springframework/data/redis/core/RedisKeyValueAdapter.java index 922a3523d..48b4ee911 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisKeyValueAdapter.java +++ b/src/main/java/org/springframework/data/redis/core/RedisKeyValueAdapter.java @@ -152,8 +152,8 @@ public class RedisKeyValueAdapter extends AbstractKeyValueAdapter super(new RedisQueryEngine()); - Assert.notNull(redisOps, "RedisOperations must not be null!"); - Assert.notNull(mappingContext, "RedisMappingContext must not be null!"); + Assert.notNull(redisOps, "RedisOperations must not be null"); + Assert.notNull(mappingContext, "RedisMappingContext must not be null"); MappingRedisConverter mappingConverter = new MappingRedisConverter(mappingContext, new PathIndexResolver(mappingContext), new ReferenceResolverImpl(redisOps)); @@ -175,7 +175,7 @@ public class RedisKeyValueAdapter extends AbstractKeyValueAdapter super(new RedisQueryEngine()); - Assert.notNull(redisOps, "RedisOperations must not be null!"); + Assert.notNull(redisOps, "RedisOperations must not be null"); this.converter = redisConverter; this.redisOps = redisOps; diff --git a/src/main/java/org/springframework/data/redis/core/RedisKeyValueTemplate.java b/src/main/java/org/springframework/data/redis/core/RedisKeyValueTemplate.java index 4627e7f00..407849170 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisKeyValueTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/RedisKeyValueTemplate.java @@ -91,7 +91,7 @@ public class RedisKeyValueTemplate extends KeyValueTemplate { */ public List find(RedisCallback callback, Class type) { - Assert.notNull(callback, "Callback must not be null."); + Assert.notNull(callback, "Callback must not be null"); return execute(new RedisKeyValueCallback>() { diff --git a/src/main/java/org/springframework/data/redis/core/RedisTemplate.java b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java index 313a5e898..58ec2200c 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java @@ -574,7 +574,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation @Override public Long countExistingKeys(Collection keys) { - Assert.notNull(keys, "Keys must not be null!"); + Assert.notNull(keys, "Keys must not be null"); byte[][] rawKeys = rawKeys(keys); return doWithKeys(connection -> connection.exists(rawKeys)); @@ -642,7 +642,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation @Override public Cursor scan(ScanOptions options) { - Assert.notNull(options, "ScanOptions must not be null!"); + Assert.notNull(options, "ScanOptions must not be null"); return executeWithStickyConnection( (RedisCallback>) connection -> new ConvertingCursor<>(connection.scan(options), diff --git a/src/main/java/org/springframework/data/redis/core/ScanCursor.java b/src/main/java/org/springframework/data/redis/core/ScanCursor.java index 17fbb6c77..d53fda00a 100644 --- a/src/main/java/org/springframework/data/redis/core/ScanCursor.java +++ b/src/main/java/org/springframework/data/redis/core/ScanCursor.java @@ -105,7 +105,7 @@ public abstract class ScanCursor implements Cursor { public final ScanCursor open() { if (!isReady()) { - throw new InvalidDataAccessApiUsageException("Cursor already " + state + ". Cannot (re)open it."); + throw new InvalidDataAccessApiUsageException("Cursor already " + state + "; Cannot (re)open it"); } state = CursorState.OPEN; @@ -177,7 +177,7 @@ public abstract class ScanCursor implements Cursor { private void assertCursorIsOpen() { if (isReady() || isClosed()) { - throw new InvalidDataAccessApiUsageException("Cannot access closed cursor. Did you forget to call open()?"); + throw new InvalidDataAccessApiUsageException("Cannot access closed cursor; Did you forget to call open()"); } } @@ -187,7 +187,7 @@ public abstract class ScanCursor implements Cursor { assertCursorIsOpen(); if (!hasNext()) { - throw new NoSuchElementException("No more elements available for cursor " + cursorId + "."); + throw new NoSuchElementException("No more elements available for cursor " + cursorId); } T next = moveNext(delegate); diff --git a/src/main/java/org/springframework/data/redis/core/ScanOptions.java b/src/main/java/org/springframework/data/redis/core/ScanOptions.java index 77ebafbae..e037fd343 100644 --- a/src/main/java/org/springframework/data/redis/core/ScanOptions.java +++ b/src/main/java/org/springframework/data/redis/core/ScanOptions.java @@ -162,7 +162,7 @@ public class ScanOptions { */ public ScanOptionsBuilder type(DataType type) { - Assert.notNull(type, "Type must not be null! Use NONE instead."); + Assert.notNull(type, "Type must not be null Use NONE instead"); this.type = type; return this; @@ -177,7 +177,7 @@ public class ScanOptions { */ public ScanOptionsBuilder type(String type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return type(DataType.fromCode(type)); } diff --git a/src/main/java/org/springframework/data/redis/core/ValueOperations.java b/src/main/java/org/springframework/data/redis/core/ValueOperations.java index 7f3882f29..c83129cf3 100644 --- a/src/main/java/org/springframework/data/redis/core/ValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ValueOperations.java @@ -67,7 +67,7 @@ public interface ValueOperations { */ default void set(K key, V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { set(key, value, timeout.toMillis(), TimeUnit.MILLISECONDS); @@ -115,7 +115,7 @@ public interface ValueOperations { @Nullable default Boolean setIfAbsent(K key, V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { return setIfAbsent(key, value, timeout.toMillis(), TimeUnit.MILLISECONDS); @@ -166,7 +166,7 @@ public interface ValueOperations { @Nullable default Boolean setIfPresent(K key, V value, Duration timeout) { - Assert.notNull(timeout, "Timeout must not be null!"); + Assert.notNull(timeout, "Timeout must not be null"); if (TimeoutUtils.hasMillis(timeout)) { return setIfPresent(key, value, timeout.toMillis(), TimeUnit.MILLISECONDS); diff --git a/src/main/java/org/springframework/data/redis/core/convert/Bucket.java b/src/main/java/org/springframework/data/redis/core/convert/Bucket.java index 67ec31ac3..1677b3b9a 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/Bucket.java +++ b/src/main/java/org/springframework/data/redis/core/convert/Bucket.java @@ -67,7 +67,7 @@ public class Bucket { Bucket(Map data) { - Assert.notNull(data, "Initial data must not be null!"); + Assert.notNull(data, "Initial data must not be null"); this.data.putAll(data); } @@ -79,7 +79,7 @@ public class Bucket { */ public void put(String path, @Nullable byte[] value) { - Assert.hasText(path, "Path to property must not be null or empty."); + Assert.hasText(path, "Path to property must not be null or empty"); data.put(path, value); } @@ -90,7 +90,7 @@ public class Bucket { */ public void remove(String path) { - Assert.hasText(path, "Path to property must not be null or empty."); + Assert.hasText(path, "Path to property must not be null or empty"); data.remove(path); } @@ -103,7 +103,7 @@ public class Bucket { @Nullable public byte[] get(String path) { - Assert.hasText(path, "Path to property must not be null or empty."); + Assert.hasText(path, "Path to property must not be null or empty"); return data.get(path); } @@ -326,7 +326,7 @@ public class Bucket { private BucketPropertyPath(Bucket bucket, String prefix) { - Assert.notNull(bucket, "Bucket must not be null!"); + Assert.notNull(bucket, "Bucket must not be null"); this.bucket = bucket; this.prefix = prefix; diff --git a/src/main/java/org/springframework/data/redis/core/convert/CompositeIndexResolver.java b/src/main/java/org/springframework/data/redis/core/convert/CompositeIndexResolver.java index 393433106..8341eacce 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/CompositeIndexResolver.java +++ b/src/main/java/org/springframework/data/redis/core/convert/CompositeIndexResolver.java @@ -48,7 +48,7 @@ public class CompositeIndexResolver implements IndexResolver { */ public CompositeIndexResolver(Collection resolvers) { - Assert.notNull(resolvers, "Resolvers must not be null!"); + Assert.notNull(resolvers, "Resolvers must not be null"); if (CollectionUtils.contains(resolvers.iterator(), null)) { throw new IllegalArgumentException("Resolvers must no contain null values"); } diff --git a/src/main/java/org/springframework/data/redis/core/convert/DefaultRedisTypeMapper.java b/src/main/java/org/springframework/data/redis/core/convert/DefaultRedisTypeMapper.java index b042330f3..d7f7bd3ea 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/DefaultRedisTypeMapper.java +++ b/src/main/java/org/springframework/data/redis/core/convert/DefaultRedisTypeMapper.java @@ -123,7 +123,7 @@ public class DefaultRedisTypeMapper extends DefaultTypeMapper type) { - Assert.notNull(type, "Type to lookup must not be null!"); + Assert.notNull(type, "Type to lookup must not be null"); if (settingsMap.containsKey(type)) { @@ -113,7 +113,7 @@ public class KeyspaceConfiguration { */ public void addKeyspaceSettings(KeyspaceSettings keyspaceSettings) { - Assert.notNull(keyspaceSettings, "KeyspaceSettings must not be null!"); + Assert.notNull(keyspaceSettings, "KeyspaceSettings must not be null"); this.settingsMap.put(keyspaceSettings.getType(), keyspaceSettings); } diff --git a/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java b/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java index 24e2ea672..54e19a997 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java +++ b/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java @@ -113,7 +113,7 @@ import org.springframework.util.comparator.NullSafeComparator; */ public class MappingRedisConverter implements RedisConverter, InitializingBean { - private static final String INVALID_TYPE_ASSIGNMENT = "Value of type %s cannot be assigned to property %s of type %s."; + private static final String INVALID_TYPE_ASSIGNMENT = "Value of type %s cannot be assigned to property %s of type %s"; private final RedisMappingContext mappingContext; private final GenericConversionService conversionService; @@ -266,7 +266,7 @@ public class MappingRedisConverter implements RedisConverter, InitializingBean { Class mapValueType = persistentProperty.getMapValueType(); if (mapValueType == null) { - throw new IllegalArgumentException("Unable to retrieve MapValueType!"); + throw new IllegalArgumentException("Unable to retrieve MapValueType"); } if (conversionService.canConvert(byte[].class, mapValueType)) { @@ -534,7 +534,7 @@ public class MappingRedisConverter implements RedisConverter, InitializingBean { map.put(((Entry) pUpdate.getValue()).getKey(), ((Entry) pUpdate.getValue()).getValue()); } else { throw new MappingException( - String.format("Cannot set update value for map property '%s' to '%s'. Please use a Map or Map.Entry.", + String.format("Cannot set update value for map property '%s' to '%s'; Please use a Map or Map.Entry", pUpdate.getPropertyPath(), pUpdate.getValue())); } @@ -792,7 +792,7 @@ public class MappingRedisConverter implements RedisConverter, InitializingBean { sink.getBucket().put(path, toBytes(value)); } else { throw new IllegalArgumentException( - String.format("Cannot convert value '%s' of type %s to bytes.", value, value.getClass())); + String.format("Cannot convert value '%s' of type %s to bytes", value, value.getClass())); } } } diff --git a/src/main/java/org/springframework/data/redis/core/convert/PathIndexResolver.java b/src/main/java/org/springframework/data/redis/core/convert/PathIndexResolver.java index 427769a0e..f18a0bcad 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/PathIndexResolver.java +++ b/src/main/java/org/springframework/data/redis/core/convert/PathIndexResolver.java @@ -76,7 +76,7 @@ public class PathIndexResolver implements IndexResolver { */ public PathIndexResolver(RedisMappingContext mappingContext) { - Assert.notNull(mappingContext, "MappingContext must not be null!"); + Assert.notNull(mappingContext, "MappingContext must not be null"); this.mappingContext = mappingContext; this.indexConfiguration = mappingContext.getMappingConfiguration().getIndexConfiguration(); diff --git a/src/main/java/org/springframework/data/redis/core/convert/RedisData.java b/src/main/java/org/springframework/data/redis/core/convert/RedisData.java index 3b6b5c311..feca5767c 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/RedisData.java +++ b/src/main/java/org/springframework/data/redis/core/convert/RedisData.java @@ -65,7 +65,7 @@ public class RedisData { */ public RedisData(Bucket bucket) { - Assert.notNull(bucket, "Bucket must not be null!"); + Assert.notNull(bucket, "Bucket must not be null"); this.bucket = bucket; this.indexedData = new HashSet<>(); @@ -103,7 +103,7 @@ public class RedisData { */ public void addIndexedData(IndexedData index) { - Assert.notNull(index, "IndexedData to add must not be null!"); + Assert.notNull(index, "IndexedData to add must not be null"); this.indexedData.add(index); } @@ -112,7 +112,7 @@ public class RedisData { */ public void addIndexedData(Collection indexes) { - Assert.notNull(indexes, "IndexedData to add must not be null!"); + Assert.notNull(indexes, "IndexedData to add must not be null"); this.indexedData.addAll(indexes); } @@ -162,8 +162,8 @@ public class RedisData { */ public void setTimeToLive(Long timeToLive, TimeUnit timeUnit) { - Assert.notNull(timeToLive, "TimeToLive must not be null when used with TimeUnit!"); - Assert.notNull(timeToLive, "TimeUnit must not be null!"); + Assert.notNull(timeToLive, "TimeToLive must not be null when used with TimeUnit"); + Assert.notNull(timeToLive, "TimeUnit must not be null"); setTimeToLive(TimeUnit.SECONDS.convert(timeToLive, timeUnit)); } diff --git a/src/main/java/org/springframework/data/redis/core/convert/ReferenceResolverImpl.java b/src/main/java/org/springframework/data/redis/core/convert/ReferenceResolverImpl.java index 4b3eecac4..17303279d 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/ReferenceResolverImpl.java +++ b/src/main/java/org/springframework/data/redis/core/convert/ReferenceResolverImpl.java @@ -41,7 +41,7 @@ public class ReferenceResolverImpl implements ReferenceResolver { */ public ReferenceResolverImpl(RedisOperations redisOperations) { - Assert.notNull(redisOperations, "RedisOperations must not be null!"); + Assert.notNull(redisOperations, "RedisOperations must not be null"); this.redisOps = redisOperations; this.converter = new StringToBytesConverter(); diff --git a/src/main/java/org/springframework/data/redis/core/convert/SpelIndexResolver.java b/src/main/java/org/springframework/data/redis/core/convert/SpelIndexResolver.java index f39d86bf1..423141a6c 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/SpelIndexResolver.java +++ b/src/main/java/org/springframework/data/redis/core/convert/SpelIndexResolver.java @@ -69,8 +69,8 @@ public class SpelIndexResolver implements IndexResolver { */ public SpelIndexResolver(RedisMappingContext mappingContext, SpelExpressionParser parser) { - Assert.notNull(mappingContext, "RedisMappingContext must not be null!"); - Assert.notNull(parser, "SpelExpressionParser must not be null!"); + Assert.notNull(mappingContext, "RedisMappingContext must not be null"); + Assert.notNull(parser, "SpelExpressionParser must not be null"); this.mappingContext = mappingContext; this.settings = mappingContext.getMappingConfiguration().getIndexConfiguration(); this.expressionCache = new HashMap<>(); diff --git a/src/main/java/org/springframework/data/redis/core/index/GeoIndexDefinition.java b/src/main/java/org/springframework/data/redis/core/index/GeoIndexDefinition.java index 3a240ab03..cfd3eb6f3 100644 --- a/src/main/java/org/springframework/data/redis/core/index/GeoIndexDefinition.java +++ b/src/main/java/org/springframework/data/redis/core/index/GeoIndexDefinition.java @@ -66,7 +66,7 @@ public class GeoIndexDefinition extends RedisIndexDefinition implements PathBase } throw new IllegalArgumentException( - String.format("Cannot convert %s to %s. GeoIndexed property needs to be of type Point or GeoLocation!", + String.format("Cannot convert %s to %s; GeoIndexed property needs to be of type Point or GeoLocation", source.getClass(), Point.class)); } } diff --git a/src/main/java/org/springframework/data/redis/core/index/IndexConfiguration.java b/src/main/java/org/springframework/data/redis/core/index/IndexConfiguration.java index 4dea43647..f60dc468e 100644 --- a/src/main/java/org/springframework/data/redis/core/index/IndexConfiguration.java +++ b/src/main/java/org/springframework/data/redis/core/index/IndexConfiguration.java @@ -76,7 +76,7 @@ public class IndexConfiguration implements ConfigurableIndexDefinitionProvider { public void addIndexDefinition(IndexDefinition indexDefinition) { - Assert.notNull(indexDefinition, "RedisIndexDefinition must not be null in order to be added."); + Assert.notNull(indexDefinition, "RedisIndexDefinition must not be null in order to be added"); this.definitions.add(indexDefinition); } diff --git a/src/main/java/org/springframework/data/redis/core/index/RedisIndexDefinition.java b/src/main/java/org/springframework/data/redis/core/index/RedisIndexDefinition.java index 7551de0d2..dcc0e9acf 100644 --- a/src/main/java/org/springframework/data/redis/core/index/RedisIndexDefinition.java +++ b/src/main/java/org/springframework/data/redis/core/index/RedisIndexDefinition.java @@ -82,7 +82,7 @@ public abstract class RedisIndexDefinition implements IndexDefinition { protected void addCondition(Condition condition) { - Assert.notNull(condition, "Condition must not be null!"); + Assert.notNull(condition, "Condition must not be null"); this.conditions.add(condition); } diff --git a/src/main/java/org/springframework/data/redis/core/mapping/BasicRedisPersistentEntity.java b/src/main/java/org/springframework/data/redis/core/mapping/BasicRedisPersistentEntity.java index a5181eaf9..8896857cc 100644 --- a/src/main/java/org/springframework/data/redis/core/mapping/BasicRedisPersistentEntity.java +++ b/src/main/java/org/springframework/data/redis/core/mapping/BasicRedisPersistentEntity.java @@ -72,7 +72,7 @@ public class BasicRedisPersistentEntity extends BasicKeyValuePersistentEntity @Nullable protected RedisPersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(RedisPersistentProperty property) { - Assert.notNull(property, "Property must not be null!"); + Assert.notNull(property, "Property must not be null"); if (!property.isIdProperty()) { return null; @@ -91,14 +91,14 @@ public class BasicRedisPersistentEntity extends BasicKeyValuePersistentEntity if (currentIdPropertyIsExplicit && newIdPropertyIsExplicit) { throw new MappingException(String.format( "Attempt to add explicit id property %s but already have an property %s registered " - + "as explicit id. Check your mapping configuration!", + + "as explicit id; Check your mapping configuration", property.getField(), currentIdProperty.getField())); } if (!currentIdPropertyIsExplicit && !newIdPropertyIsExplicit) { throw new MappingException( String.format("Attempt to add id property %s but already have an property %s registered " - + "as id. Check your mapping configuration!", property.getField(), currentIdProperty.getField())); + + "as id; Check your mapping configuration", property.getField(), currentIdProperty.getField())); } if (newIdPropertyIsExplicit) { diff --git a/src/main/java/org/springframework/data/redis/core/mapping/RedisMappingContext.java b/src/main/java/org/springframework/data/redis/core/mapping/RedisMappingContext.java index 885ace910..30fd73704 100644 --- a/src/main/java/org/springframework/data/redis/core/mapping/RedisMappingContext.java +++ b/src/main/java/org/springframework/data/redis/core/mapping/RedisMappingContext.java @@ -135,7 +135,7 @@ public class RedisMappingContext extends KeyValueMappingContext type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); if (keyspaceConfig.hasSettingsFor(type)) { String value = keyspaceConfig.getKeyspaceSettings(type).getKeyspace(); @@ -161,7 +161,7 @@ public class RedisMappingContext extends KeyValueMappingContext type) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); return ClassUtils.getUserClass(type).getName(); } } @@ -188,8 +188,8 @@ public class RedisMappingContext extends KeyValueMappingContext(); this.timeoutProperties = new HashMap<>(); @@ -202,7 +202,7 @@ public class RedisMappingContext extends KeyValueMappingContext type = source instanceof Class ? (Class) source : (source instanceof PartialUpdate ? ((PartialUpdate) source).getTarget() : source.getClass()); diff --git a/src/main/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutor.java b/src/main/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutor.java index 228f93743..4846031c1 100644 --- a/src/main/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutor.java +++ b/src/main/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutor.java @@ -57,8 +57,8 @@ public class DefaultReactiveScriptExecutor implements ReactiveScriptExecutor< public DefaultReactiveScriptExecutor(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext serializationContext) { - Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null!"); - Assert.notNull(serializationContext, "RedisSerializationContext must not be null!"); + Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null"); + Assert.notNull(serializationContext, "RedisSerializationContext must not be null"); this.connectionFactory = connectionFactory; this.serializationContext = serializationContext; @@ -68,9 +68,9 @@ public class DefaultReactiveScriptExecutor implements ReactiveScriptExecutor< @SuppressWarnings("unchecked") public Flux execute(RedisScript script, List keys, List args) { - Assert.notNull(script, "RedisScript must not be null!"); - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(script, "RedisScript must not be null"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(args, "Args must not be null"); SerializationPair serializationPair = serializationContext.getValueSerializationPair(); @@ -83,11 +83,11 @@ public class DefaultReactiveScriptExecutor implements ReactiveScriptExecutor< public Flux execute(RedisScript script, List keys, List args, RedisElementWriter argsWriter, RedisElementReader resultReader) { - Assert.notNull(script, "RedisScript must not be null!"); - Assert.notNull(argsWriter, "Argument Writer must not be null!"); - Assert.notNull(resultReader, "Result Reader must not be null!"); - Assert.notNull(keys, "Keys must not be null!"); - Assert.notNull(args, "Args must not be null!"); + Assert.notNull(script, "RedisScript must not be null"); + Assert.notNull(argsWriter, "Argument Writer must not be null"); + Assert.notNull(resultReader, "Result Reader must not be null"); + Assert.notNull(keys, "Keys must not be null"); + Assert.notNull(args, "Args must not be null"); return execute(connection -> { diff --git a/src/main/java/org/springframework/data/redis/core/script/RedisScript.java b/src/main/java/org/springframework/data/redis/core/script/RedisScript.java index 405ce7bc5..4363d9292 100644 --- a/src/main/java/org/springframework/data/redis/core/script/RedisScript.java +++ b/src/main/java/org/springframework/data/redis/core/script/RedisScript.java @@ -77,8 +77,8 @@ public interface RedisScript { */ static RedisScript of(String script, Class resultType) { - Assert.notNull(script, "Script must not be null!"); - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(script, "Script must not be null"); + Assert.notNull(resultType, "ResultType must not be null"); return new DefaultRedisScript<>(script, resultType); } @@ -93,7 +93,7 @@ public interface RedisScript { */ static RedisScript of(Resource resource) { - Assert.notNull(resource, "Resource must not be null!"); + Assert.notNull(resource, "Resource must not be null"); DefaultRedisScript script = new DefaultRedisScript<>(); script.setLocation(resource); @@ -112,8 +112,8 @@ public interface RedisScript { */ static RedisScript of(Resource resource, Class resultType) { - Assert.notNull(resource, "Resource must not be null!"); - Assert.notNull(resultType, "ResultType must not be null!"); + Assert.notNull(resource, "Resource must not be null"); + Assert.notNull(resultType, "ResultType must not be null"); DefaultRedisScript script = new DefaultRedisScript<>(); script.setResultType(resultType); diff --git a/src/main/java/org/springframework/data/redis/core/types/Expiration.java b/src/main/java/org/springframework/data/redis/core/types/Expiration.java index 50c9a33eb..f4c19e7d1 100644 --- a/src/main/java/org/springframework/data/redis/core/types/Expiration.java +++ b/src/main/java/org/springframework/data/redis/core/types/Expiration.java @@ -91,7 +91,7 @@ public class Expiration { */ public long getConverted(TimeUnit targetTimeUnit) { - Assert.notNull(targetTimeUnit, "TargetTimeUnit must not be null!"); + Assert.notNull(targetTimeUnit, "TargetTimeUnit must not be null"); return targetTimeUnit.convert(expirationTime, timeUnit); } @@ -175,7 +175,7 @@ public class Expiration { */ public static Expiration from(Duration duration) { - Assert.notNull(duration, "Duration must not be null!"); + Assert.notNull(duration, "Duration must not be null"); if (duration.toMillis() % 1000 == 0) { return new Expiration(duration.getSeconds(), TimeUnit.SECONDS); diff --git a/src/main/java/org/springframework/data/redis/core/types/RedisClientInfo.java b/src/main/java/org/springframework/data/redis/core/types/RedisClientInfo.java index 0110ada85..ee61bceb0 100644 --- a/src/main/java/org/springframework/data/redis/core/types/RedisClientInfo.java +++ b/src/main/java/org/springframework/data/redis/core/types/RedisClientInfo.java @@ -56,7 +56,7 @@ public class RedisClientInfo { */ public RedisClientInfo(Properties properties) { - Assert.notNull(properties, "Cannot initialize client information for given 'null' properties."); + Assert.notNull(properties, "Cannot initialize client information for given 'null' properties"); this.clientProperties = new Properties(); this.clientProperties.putAll(properties); @@ -221,7 +221,7 @@ public class RedisClientInfo { */ public String get(INFO info) { - Assert.notNull(info, "Cannot retrieve client information for 'null'."); + Assert.notNull(info, "Cannot retrieve client information for 'null'"); return this.clientProperties.getProperty(info.key); } @@ -232,7 +232,7 @@ public class RedisClientInfo { @Nullable public String get(String key) { - Assert.hasText(key, "Cannot get client information for 'empty' / 'null' key."); + Assert.hasText(key, "Cannot get client information for 'empty' / 'null' key"); return this.clientProperties.getProperty(key); } @@ -269,12 +269,12 @@ public class RedisClientInfo { public static RedisClientInfo fromString(String source) { - Assert.notNull(source, "Cannot read client properties form 'null'."); + Assert.notNull(source, "Cannot read client properties form 'null'"); Properties properties = new Properties(); try { properties.load(new StringReader(source.replace(' ', '\n'))); } catch (IOException e) { - throw new IllegalArgumentException(String.format("Properties could not be loaded from String '%s'.", source), + throw new IllegalArgumentException(String.format("Properties could not be loaded from String '%s'", source), e); } return new RedisClientInfo(properties); diff --git a/src/main/java/org/springframework/data/redis/domain/geo/BoundingBox.java b/src/main/java/org/springframework/data/redis/domain/geo/BoundingBox.java index 8141278ea..f76d9a652 100644 --- a/src/main/java/org/springframework/data/redis/domain/geo/BoundingBox.java +++ b/src/main/java/org/springframework/data/redis/domain/geo/BoundingBox.java @@ -44,9 +44,9 @@ public class BoundingBox implements Shape { */ public BoundingBox(Distance width, Distance height) { - Assert.notNull(width, "Width must not be null!"); - Assert.notNull(height, "Height must not be null!"); - Assert.isTrue(width.getMetric().equals(height.getMetric()), "Metric for width and height must be the same!"); + Assert.notNull(width, "Width must not be null"); + Assert.notNull(height, "Height must not be null"); + Assert.isTrue(width.getMetric().equals(height.getMetric()), "Metric for width and height must be the same"); this.width = width; this.height = height; diff --git a/src/main/java/org/springframework/data/redis/hash/Jackson2HashMapper.java b/src/main/java/org/springframework/data/redis/hash/Jackson2HashMapper.java index 568cb4f38..72be86b6c 100644 --- a/src/main/java/org/springframework/data/redis/hash/Jackson2HashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/Jackson2HashMapper.java @@ -204,7 +204,7 @@ public class Jackson2HashMapper implements HashMapper { */ public Jackson2HashMapper(ObjectMapper mapper, boolean flatten) { - Assert.notNull(mapper, "Mapper must not be null!"); + Assert.notNull(mapper, "Mapper must not be null"); this.typingMapper = mapper; this.flatten = flatten; diff --git a/src/main/java/org/springframework/data/redis/hash/ObjectHashMapper.java b/src/main/java/org/springframework/data/redis/hash/ObjectHashMapper.java index c0264d796..8a357e19c 100644 --- a/src/main/java/org/springframework/data/redis/hash/ObjectHashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/ObjectHashMapper.java @@ -91,7 +91,7 @@ public class ObjectHashMapper implements HashMapper { */ public ObjectHashMapper(RedisConverter converter) { - Assert.notNull(converter, "Converter must not be null!"); + Assert.notNull(converter, "Converter must not be null"); this.converter = converter; } diff --git a/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java b/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java index 9ab11e807..6ba988234 100644 --- a/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java +++ b/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java @@ -35,7 +35,7 @@ public class ChannelTopic implements Topic { */ public ChannelTopic(String name) { - Assert.notNull(name, "Topic name must not be null!"); + Assert.notNull(name, "Topic name must not be null"); this.channelName = name; } diff --git a/src/main/java/org/springframework/data/redis/listener/KeyspaceEventMessageListener.java b/src/main/java/org/springframework/data/redis/listener/KeyspaceEventMessageListener.java index 048c836e4..6eb885bac 100644 --- a/src/main/java/org/springframework/data/redis/listener/KeyspaceEventMessageListener.java +++ b/src/main/java/org/springframework/data/redis/listener/KeyspaceEventMessageListener.java @@ -49,7 +49,7 @@ public abstract class KeyspaceEventMessageListener implements MessageListener, I */ public KeyspaceEventMessageListener(RedisMessageListenerContainer listenerContainer) { - Assert.notNull(listenerContainer, "RedisMessageListenerContainer to run in must not be null!"); + Assert.notNull(listenerContainer, "RedisMessageListenerContainer to run in must not be null"); this.listenerContainer = listenerContainer; } diff --git a/src/main/java/org/springframework/data/redis/listener/PatternTopic.java b/src/main/java/org/springframework/data/redis/listener/PatternTopic.java index 4680f8491..0e63278fb 100644 --- a/src/main/java/org/springframework/data/redis/listener/PatternTopic.java +++ b/src/main/java/org/springframework/data/redis/listener/PatternTopic.java @@ -36,7 +36,7 @@ public class PatternTopic implements Topic { */ public PatternTopic(String pattern) { - Assert.notNull(pattern, "Pattern must not be null!"); + Assert.notNull(pattern, "Pattern must not be null"); this.channelPattern = pattern; } diff --git a/src/main/java/org/springframework/data/redis/listener/ReactiveRedisMessageListenerContainer.java b/src/main/java/org/springframework/data/redis/listener/ReactiveRedisMessageListenerContainer.java index 65b53483c..722d0ca60 100644 --- a/src/main/java/org/springframework/data/redis/listener/ReactiveRedisMessageListenerContainer.java +++ b/src/main/java/org/springframework/data/redis/listener/ReactiveRedisMessageListenerContainer.java @@ -84,7 +84,7 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { */ public ReactiveRedisMessageListenerContainer(ReactiveRedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null"); this.connection = connectionFactory.getReactiveConnection(); } @@ -151,8 +151,8 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { */ public Flux> receive(ChannelTopic... channelTopics) { - Assert.notNull(channelTopics, "ChannelTopics must not be null!"); - Assert.noNullElements(channelTopics, "ChannelTopics must not contain null elements!"); + Assert.notNull(channelTopics, "ChannelTopics must not be null"); + Assert.noNullElements(channelTopics, "ChannelTopics must not contain null elements"); return receive(Arrays.asList(channelTopics), stringSerializationPair, stringSerializationPair); } @@ -173,8 +173,8 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { */ public Mono>> receiveLater(ChannelTopic... channelTopics) { - Assert.notNull(channelTopics, "ChannelTopics must not be null!"); - Assert.noNullElements(channelTopics, "ChannelTopics must not contain null elements!"); + Assert.notNull(channelTopics, "ChannelTopics must not be null"); + Assert.noNullElements(channelTopics, "ChannelTopics must not contain null elements"); return receiveLater(Arrays.asList(channelTopics), stringSerializationPair, stringSerializationPair); } @@ -193,8 +193,8 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { @SuppressWarnings("unchecked") public Flux> receive(PatternTopic... patternTopics) { - Assert.notNull(patternTopics, "PatternTopic must not be null!"); - Assert.noNullElements(patternTopics, "PatternTopic must not contain null elements!"); + Assert.notNull(patternTopics, "PatternTopic must not be null"); + Assert.noNullElements(patternTopics, "PatternTopic must not contain null elements"); return receive(Arrays.asList(patternTopics), stringSerializationPair, stringSerializationPair) .map(m -> (PatternMessage) m); @@ -217,8 +217,8 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { @SuppressWarnings("unchecked") public Mono>> receiveLater(PatternTopic... patternTopics) { - Assert.notNull(patternTopics, "PatternTopic must not be null!"); - Assert.noNullElements(patternTopics, "PatternTopic must not contain null elements!"); + Assert.notNull(patternTopics, "PatternTopic must not be null"); + Assert.noNullElements(patternTopics, "PatternTopic must not contain null elements"); return receiveLater(Arrays.asList(patternTopics), stringSerializationPair, stringSerializationPair) .map(it -> it.map(m -> (PatternMessage) m)); @@ -280,10 +280,10 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { public Flux> receive(Iterable topics, SerializationPair channelSerializer, SerializationPair messageSerializer, SubscriptionListener subscriptionListener) { - Assert.notNull(topics, "Topics must not be null!"); - Assert.notNull(channelSerializer, "Channel serializer must not be null!"); - Assert.notNull(messageSerializer, "Message serializer must not be null!"); - Assert.notNull(subscriptionListener, "SubscriptionListener must not be null!"); + Assert.notNull(topics, "Topics must not be null"); + Assert.notNull(channelSerializer, "Channel serializer must not be null"); + Assert.notNull(messageSerializer, "Message serializer must not be null"); + Assert.notNull(subscriptionListener, "SubscriptionListener must not be null"); verifyConnection(); @@ -291,7 +291,7 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { ByteBuffer[] channels = getTargets(topics, ChannelTopic.class); if (ObjectUtils.isEmpty(patterns) && ObjectUtils.isEmpty(channels)) { - throw new InvalidDataAccessApiUsageException("No channels or patterns to subscribe to."); + throw new InvalidDataAccessApiUsageException("No channels or patterns to subscribe to"); } return doReceive(channelSerializer, messageSerializer, @@ -342,9 +342,9 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { public Mono>> receiveLater(Iterable topics, SerializationPair channelSerializer, SerializationPair messageSerializer) { - Assert.notNull(topics, "Topics must not be null!"); - Assert.notNull(channelSerializer, "Channel serializer must not be null!"); - Assert.notNull(messageSerializer, "Message serializer must not be null!"); + Assert.notNull(topics, "Topics must not be null"); + Assert.notNull(channelSerializer, "Channel serializer must not be null"); + Assert.notNull(messageSerializer, "Message serializer must not be null"); verifyConnection(); @@ -352,7 +352,7 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { ByteBuffer[] channels = getTargets(topics, ChannelTopic.class); if (ObjectUtils.isEmpty(patterns) && ObjectUtils.isEmpty(channels)) { - throw new InvalidDataAccessApiUsageException("No channels or patterns to subscribe to."); + throw new InvalidDataAccessApiUsageException("No channels or patterns to subscribe to"); } return Mono.defer(() -> { @@ -392,7 +392,7 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { private static Mono subscribe(ByteBuffer[] patterns, ByteBuffer[] channels, ReactiveSubscription it) { Assert.isTrue(!ObjectUtils.isEmpty(channels) || !ObjectUtils.isEmpty(patterns), - "Must provide either channels or patterns!"); + "Must provide either channels or patterns"); Mono subscribe = null; @@ -421,7 +421,7 @@ public class ReactiveRedisMessageListenerContainer implements DisposableBean { private void verifyConnection() { if (!isActive()) { - throw new IllegalStateException("ReactiveRedisMessageListenerContainer is already disposed!"); + throw new IllegalStateException("ReactiveRedisMessageListenerContainer is already disposed"); } } diff --git a/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java b/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java index 99ada10f6..c93cc3d7a 100644 --- a/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java +++ b/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java @@ -168,7 +168,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab @Override public void afterPropertiesSet() { - Assert.state(!afterPropertiesSet, "Container already initialized."); + Assert.state(!afterPropertiesSet, "Container already initialized"); if (this.connectionFactory == null) { throw new IllegalArgumentException("RedisConnectionFactory is not set"); @@ -217,7 +217,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab ((DisposableBean) taskExecutor).destroy(); if (logger.isDebugEnabled()) { - logger.debug("Stopped internally-managed task executor."); + logger.debug("Stopped internally-managed task executor"); } } } @@ -277,7 +277,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab throw new CompletionException(e.getCause()); } catch (TimeoutException e) { - throw new IllegalStateException("Subscription registration timeout exceeded.", e); + throw new IllegalStateException("Subscription registration timeout exceeded", e); } } @@ -287,7 +287,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab private CompletableFuture lazyListen(BackOffExecution backOffExecution) { if (!hasTopics()) { - logger.debug("Postpone listening for Redis messages until actual listeners are added."); + logger.debug("Postpone listening for Redis messages until actual listeners are added"); return CompletableFuture.completedFuture(null); } @@ -321,10 +321,10 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab listenFuture.whenComplete((unused, throwable) -> { if (throwable == null) { - logger.debug("RedisMessageListenerContainer listeners registered successfully."); + logger.debug("RedisMessageListenerContainer listeners registered successfully"); this.state.set(State.listening()); } else { - logger.debug("Failed to start RedisMessageListenerContainer listeners.", throwable); + logger.debug("Failed to start RedisMessageListenerContainer listeners", throwable); this.state.set(State.notListening()); } @@ -336,7 +336,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab } }); - logger.debug("Subscribing to topics for RedisMessageListenerContainer."); + logger.debug("Subscribing to topics for RedisMessageListenerContainer"); return true; } @@ -376,7 +376,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab stopListening(); if (logger.isDebugEnabled()) { - logger.debug("Stopped RedisMessageListenerContainer."); + logger.debug("Stopped RedisMessageListenerContainer"); } callback.run(); @@ -411,7 +411,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab this.unsubscribeFuture = new CompletableFuture<>(); if (logger.isDebugEnabled()) { - logger.debug("Stopped listening."); + logger.debug("Stopped listening"); } return true; @@ -461,7 +461,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab */ public void setConnectionFactory(RedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); this.connectionFactory = connectionFactory; } @@ -877,7 +877,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab if (this.errorHandler != null) { this.errorHandler.handleError(ex); } else if (logger.isWarnEnabled()) { - logger.warn("Execution of message listener failed, and no ErrorHandler has been set.", ex); + logger.warn("Execution of message listener failed, and no ErrorHandler has been set", ex); } } @@ -899,7 +899,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab long recoveryInterval = backOffExecution.nextBackOff(); if (recoveryInterval != BackOffExecution.STOP) { - logger.error(String.format("Connection failure occurred: %s. Restarting subscription task after %s ms.", ex, + logger.error(String.format("Connection failure occurred: %s; Restarting subscription task after %s ms", ex, recoveryInterval), ex); } @@ -1002,7 +1002,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab if (this.subscriber == null) { throw new IllegalStateException( - "Subscriber not created. Configure RedisConnectionFactory to create a Subscriber."); + "Subscriber not created; Configure RedisConnectionFactory to create a Subscriber"); } return subscriber; diff --git a/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java b/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java index 687d432b7..e839a8f38 100644 --- a/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java +++ b/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java @@ -119,7 +119,7 @@ public class MessageListenerAdapter implements InitializingBean, MessageListener }, new MostSpecificMethodFilter(methodName, c)); Assert.isTrue(lenient || !methods.isEmpty(), "Cannot find a suitable method named [" + c.getName() + "#" - + methodName + "] - is the method public and has the proper arguments?"); + + methodName + "] - is the method public and has the proper arguments"); } void invoke(Object[] arguments) throws InvocationTargetException, IllegalAccessException { @@ -271,7 +271,7 @@ public class MessageListenerAdapter implements InitializingBean, MessageListener if (!StringUtils.hasText(methodName)) { throw new InvalidDataAccessApiUsageException("No default listener method specified: " + "Either specify a non-null value for the 'defaultListenerMethod' property or " - + "override the 'getListenerMethodName' method."); + + "override the 'getListenerMethodName' method"); } invoker = new MethodInvoker(delegate, methodName); diff --git a/src/main/java/org/springframework/data/redis/repository/cdi/CdiBean.java b/src/main/java/org/springframework/data/redis/repository/cdi/CdiBean.java index 522ea71c5..a11b7753d 100644 --- a/src/main/java/org/springframework/data/redis/repository/cdi/CdiBean.java +++ b/src/main/java/org/springframework/data/redis/repository/cdi/CdiBean.java @@ -78,10 +78,10 @@ public abstract class CdiBean implements Bean, PassivationCapable { */ public CdiBean(Set qualifiers, Set types, Class beanClass, BeanManager beanManager) { - Assert.notNull(qualifiers, "Qualifier annotations must not be null!"); - Assert.notNull(beanManager, "BeanManager must not be null!"); - Assert.notNull(types, "Types must not be null!"); - Assert.notNull(beanClass, "Bean class mast not be null!"); + Assert.notNull(qualifiers, "Qualifier annotations must not be null"); + Assert.notNull(beanManager, "BeanManager must not be null"); + Assert.notNull(types, "Types must not be null"); + Assert.notNull(beanClass, "Bean class mast not be null"); this.qualifiers = qualifiers; this.types = types; diff --git a/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueAdapterBean.java b/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueAdapterBean.java index b9edb5b35..8fcdf5fd7 100644 --- a/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueAdapterBean.java +++ b/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueAdapterBean.java @@ -51,7 +51,7 @@ public class RedisKeyValueAdapterBean extends CdiBean { BeanManager beanManager) { super(qualifiers, RedisKeyValueAdapter.class, beanManager); - Assert.notNull(redisOperations, "RedisOperations Bean must not be null!"); + Assert.notNull(redisOperations, "RedisOperations Bean must not be null"); this.redisOperations = redisOperations; } diff --git a/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueTemplateBean.java b/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueTemplateBean.java index f90a7f953..34b00a737 100644 --- a/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueTemplateBean.java +++ b/src/main/java/org/springframework/data/redis/repository/cdi/RedisKeyValueTemplateBean.java @@ -51,7 +51,7 @@ public class RedisKeyValueTemplateBean extends CdiBean { BeanManager beanManager) { super(qualifiers, KeyValueOperations.class, beanManager); - Assert.notNull(keyValueAdapter, "KeyValueAdapter bean must not be null!"); + Assert.notNull(keyValueAdapter, "KeyValueAdapter bean must not be null"); this.keyValueAdapter = keyValueAdapter; } diff --git a/src/main/java/org/springframework/data/redis/repository/cdi/RedisRepositoryBean.java b/src/main/java/org/springframework/data/redis/repository/cdi/RedisRepositoryBean.java index 34be3d604..aed21ae1e 100644 --- a/src/main/java/org/springframework/data/redis/repository/cdi/RedisRepositoryBean.java +++ b/src/main/java/org/springframework/data/redis/repository/cdi/RedisRepositoryBean.java @@ -56,7 +56,7 @@ public class RedisRepositoryBean extends CdiRepositoryBean { super(qualifiers, repositoryType, beanManager, Optional.ofNullable(detector)); - Assert.notNull(keyValueTemplate, "Bean holding keyvalue template must not be null!"); + Assert.notNull(keyValueTemplate, "Bean holding keyvalue template must not be null"); this.keyValueTemplate = keyValueTemplate; } diff --git a/src/main/java/org/springframework/data/redis/repository/configuration/RedisRepositoryConfigurationExtension.java b/src/main/java/org/springframework/data/redis/repository/configuration/RedisRepositoryConfigurationExtension.java index 951655386..d7de3ae2e 100644 --- a/src/main/java/org/springframework/data/redis/repository/configuration/RedisRepositoryConfigurationExtension.java +++ b/src/main/java/org/springframework/data/redis/repository/configuration/RedisRepositoryConfigurationExtension.java @@ -74,7 +74,7 @@ public class RedisRepositoryConfigurationExtension extends KeyValueRepositoryCon if (!StringUtils.hasText(redisTemplateRef)) { throw new IllegalStateException( - "@EnableRedisRepositories(redisTemplateRef = … ) must be configured to a non empty value!"); + "@EnableRedisRepositories(redisTemplateRef = … ) must be configured to a non empty value"); } registerIfNotAlreadyRegistered(() -> createRedisMappingContext(configuration), registry, MAPPING_CONTEXT_BEAN_NAME, diff --git a/src/main/java/org/springframework/data/redis/repository/core/MappingRedisEntityInformation.java b/src/main/java/org/springframework/data/redis/repository/core/MappingRedisEntityInformation.java index 629c0287b..dc3cfb603 100644 --- a/src/main/java/org/springframework/data/redis/repository/core/MappingRedisEntityInformation.java +++ b/src/main/java/org/springframework/data/redis/repository/core/MappingRedisEntityInformation.java @@ -42,7 +42,7 @@ public class MappingRedisEntityInformation extends PersistentEntityInform if (!entity.hasIdProperty()) { throw new MappingException( - String.format("Entity %s requires to have an explicit id field. Did you forget to provide one using @Id?", + String.format("Entity %s requires to have an explicit id field; Did you forget to provide one using @Id", entity.getName())); } } diff --git a/src/main/java/org/springframework/data/redis/repository/query/ExampleQueryMapper.java b/src/main/java/org/springframework/data/redis/repository/query/ExampleQueryMapper.java index 7b4dbfb06..ac958d8dd 100644 --- a/src/main/java/org/springframework/data/redis/repository/query/ExampleQueryMapper.java +++ b/src/main/java/org/springframework/data/redis/repository/query/ExampleQueryMapper.java @@ -66,8 +66,8 @@ public class ExampleQueryMapper { public ExampleQueryMapper(MappingContext, RedisPersistentProperty> mappingContext, IndexResolver indexResolver) { - Assert.notNull(mappingContext, "MappingContext must not be null!"); - Assert.notNull(indexResolver, "IndexResolver must not be null!"); + Assert.notNull(mappingContext, "MappingContext must not be null"); + Assert.notNull(indexResolver, "IndexResolver must not be null"); this.mappingContext = mappingContext; this.indexResolver = indexResolver; @@ -139,7 +139,7 @@ public class ExampleQueryMapper { if (!SUPPORTED_MATCHERS.contains(stringMatcher)) { throw new InvalidDataAccessApiUsageException( - String.format("Redis Query-by-Example does not support string matcher %s. Supported matchers are: %s.", + String.format("Redis Query-by-Example does not support string matcher %s; Supported matchers are: %s.", stringMatcher, SUPPORTED_MATCHERS)); } diff --git a/src/main/java/org/springframework/data/redis/repository/query/RedisOperationChain.java b/src/main/java/org/springframework/data/redis/repository/query/RedisOperationChain.java index 9e45c2a52..65c8cf2a8 100644 --- a/src/main/java/org/springframework/data/redis/repository/query/RedisOperationChain.java +++ b/src/main/java/org/springframework/data/redis/repository/query/RedisOperationChain.java @@ -76,7 +76,7 @@ public class RedisOperationChain { public void near(NearPath near) { - Assert.notNull(near, "Near must not be null!"); + Assert.notNull(near, "Near must not be null"); this.near = near; } diff --git a/src/main/java/org/springframework/data/redis/repository/query/RedisQueryCreator.java b/src/main/java/org/springframework/data/redis/repository/query/RedisQueryCreator.java index 710e81415..c47edf8f6 100644 --- a/src/main/java/org/springframework/data/redis/repository/query/RedisQueryCreator.java +++ b/src/main/java/org/springframework/data/redis/repository/query/RedisQueryCreator.java @@ -66,7 +66,7 @@ public class RedisQueryCreator extends AbstractQueryCreator public QueryByExampleRedisExecutor(EntityInformation entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver) { - Assert.notNull(entityInformation, "EntityInformation must not be null!"); - Assert.notNull(keyValueTemplate, "RedisKeyValueTemplate must not be null!"); - Assert.notNull(indexResolver, "IndexResolver must not be null!"); + Assert.notNull(entityInformation, "EntityInformation must not be null"); + Assert.notNull(keyValueTemplate, "RedisKeyValueTemplate must not be null"); + Assert.notNull(indexResolver, "IndexResolver must not be null"); this.entityInformation = entityInformation; this.keyValueTemplate = keyValueTemplate; @@ -162,7 +162,7 @@ public class QueryByExampleRedisExecutor @Override public Page findAll(Example example, Pageable pageable) { - Assert.notNull(pageable, "Pageable must not be null!"); + Assert.notNull(pageable, "Pageable must not be null"); RedisOperationChain operationChain = createQuery(example); @@ -193,15 +193,15 @@ public class QueryByExampleRedisExecutor public R findBy(Example example, Function, R> queryFunction) { - Assert.notNull(example, "Example must not be null!"); - Assert.notNull(queryFunction, "Query function must not be null!"); + Assert.notNull(example, "Example must not be null"); + Assert.notNull(queryFunction, "Query function must not be null"); return queryFunction.apply(new FluentQueryByExample<>(example, example.getProbeType())); } private RedisOperationChain createQuery(Example example) { - Assert.notNull(example, "Example must not be null!"); + Assert.notNull(example, "Example must not be null"); return mapper.getMappedExample(example); } @@ -279,7 +279,7 @@ public class QueryByExampleRedisExecutor @Override public Page page(Pageable pageable) { - Assert.notNull(pageable, "Pageable must not be null!"); + Assert.notNull(pageable, "Pageable must not be null"); Function conversionFunction = getConversionFunction(entityInformation.getJavaType(), resultType); diff --git a/src/main/java/org/springframework/data/redis/serializer/DefaultRedisSerializationContext.java b/src/main/java/org/springframework/data/redis/serializer/DefaultRedisSerializationContext.java index 903a2a08b..2fc509b87 100644 --- a/src/main/java/org/springframework/data/redis/serializer/DefaultRedisSerializationContext.java +++ b/src/main/java/org/springframework/data/redis/serializer/DefaultRedisSerializationContext.java @@ -88,7 +88,7 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContextBuilder key(SerializationPair tuple) { - Assert.notNull(tuple, "SerializationPair must not be null!"); + Assert.notNull(tuple, "SerializationPair must not be null"); this.keyTuple = tuple; return this; @@ -97,7 +97,7 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContextBuilder value(SerializationPair tuple) { - Assert.notNull(tuple, "SerializationPair must not be null!"); + Assert.notNull(tuple, "SerializationPair must not be null"); this.valueTuple = tuple; return this; @@ -106,7 +106,7 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContextBuilder hashKey(SerializationPair tuple) { - Assert.notNull(tuple, "SerializationPair must not be null!"); + Assert.notNull(tuple, "SerializationPair must not be null"); this.hashKeyTuple = tuple; return this; @@ -115,7 +115,7 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContextBuilder hashValue(SerializationPair tuple) { - Assert.notNull(tuple, "SerializationPair must not be null!"); + Assert.notNull(tuple, "SerializationPair must not be null"); this.hashValueTuple = tuple; return this; @@ -124,7 +124,7 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContextBuilder string(SerializationPair tuple) { - Assert.notNull(tuple, "SerializationPair must not be null!"); + Assert.notNull(tuple, "SerializationPair must not be null"); this.hashValueTuple = tuple; return this; @@ -133,10 +133,10 @@ class DefaultRedisSerializationContext implements RedisSerializationContex @Override public RedisSerializationContext build() { - Assert.notNull(keyTuple, "Key SerializationPair must not be null!"); - Assert.notNull(valueTuple, "Value SerializationPair must not be null!"); - Assert.notNull(hashKeyTuple, "HashKey SerializationPair must not be null!"); - Assert.notNull(hashValueTuple, "ValueKey SerializationPair must not be null!"); + Assert.notNull(keyTuple, "Key SerializationPair must not be null"); + Assert.notNull(valueTuple, "Value SerializationPair must not be null"); + Assert.notNull(hashKeyTuple, "HashKey SerializationPair must not be null"); + Assert.notNull(hashValueTuple, "ValueKey SerializationPair must not be null"); return new DefaultRedisSerializationContext<>(keyTuple, valueTuple, hashKeyTuple, hashValueTuple, stringTuple); diff --git a/src/main/java/org/springframework/data/redis/serializer/GenericJackson2JsonRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/GenericJackson2JsonRedisSerializer.java index 8fca10fbd..23b513be1 100644 --- a/src/main/java/org/springframework/data/redis/serializer/GenericJackson2JsonRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/GenericJackson2JsonRedisSerializer.java @@ -88,7 +88,7 @@ public class GenericJackson2JsonRedisSerializer implements RedisSerializer T deserialize(@Nullable byte[] source, Class type) throws SerializationException { Assert.notNull(type, - "Deserialization type must not be null! Please provide Object.class to make use of Jackson2 default typing."); + "Deserialization type must not be null Please provide Object.class to make use of Jackson2 default typing."); if (SerializationUtils.isEmpty(source)) { return null; diff --git a/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java b/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java index ea73e9413..91c23127b 100644 --- a/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java @@ -51,7 +51,7 @@ public class GenericToStringSerializer implements RedisSerializer, BeanFac public GenericToStringSerializer(Class type, Charset charset) { - Assert.notNull(type, "Type must not be null!"); + Assert.notNull(type, "Type must not be null"); this.type = type; this.charset = charset; diff --git a/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java index 9f57d99fc..c6d9d06b1 100644 --- a/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java @@ -65,8 +65,8 @@ public class JdkSerializationRedisSerializer implements RedisSerializer */ public JdkSerializationRedisSerializer(Converter serializer, Converter deserializer) { - Assert.notNull(serializer, "Serializer must not be null!"); - Assert.notNull(deserializer, "Deserializer must not be null!"); + Assert.notNull(serializer, "Serializer must not be null"); + Assert.notNull(deserializer, "Deserializer must not be null"); this.serializer = serializer; this.deserializer = deserializer; diff --git a/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java b/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java index 3d5785186..9dad86c41 100644 --- a/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java @@ -62,7 +62,7 @@ public class OxmSerializer implements InitializingBean, RedisSerializer */ public void setMarshaller(Marshaller marshaller) { - Assert.notNull(marshaller, "Marshaller must not be null!"); + Assert.notNull(marshaller, "Marshaller must not be null"); this.marshaller = marshaller; } @@ -72,7 +72,7 @@ public class OxmSerializer implements InitializingBean, RedisSerializer */ public void setUnmarshaller(Unmarshaller unmarshaller) { - Assert.notNull(unmarshaller, "Unmarshaller must not be null!"); + Assert.notNull(unmarshaller, "Unmarshaller must not be null"); this.unmarshaller = unmarshaller; } diff --git a/src/main/java/org/springframework/data/redis/serializer/RedisElementReader.java b/src/main/java/org/springframework/data/redis/serializer/RedisElementReader.java index e51021c7f..d2441009e 100644 --- a/src/main/java/org/springframework/data/redis/serializer/RedisElementReader.java +++ b/src/main/java/org/springframework/data/redis/serializer/RedisElementReader.java @@ -48,7 +48,7 @@ public interface RedisElementReader { */ static RedisElementReader from(RedisSerializer serializer) { - Assert.notNull(serializer, "Serializer must not be null!"); + Assert.notNull(serializer, "Serializer must not be null"); return new DefaultRedisElementReader<>(serializer); } } diff --git a/src/main/java/org/springframework/data/redis/serializer/RedisElementWriter.java b/src/main/java/org/springframework/data/redis/serializer/RedisElementWriter.java index 66dc4f99e..61da28a53 100644 --- a/src/main/java/org/springframework/data/redis/serializer/RedisElementWriter.java +++ b/src/main/java/org/springframework/data/redis/serializer/RedisElementWriter.java @@ -46,7 +46,7 @@ public interface RedisElementWriter { */ static RedisElementWriter from(RedisSerializer serializer) { - Assert.notNull(serializer, "Serializer must not be null!"); + Assert.notNull(serializer, "Serializer must not be null"); return new DefaultRedisElementWriter<>(serializer); } } diff --git a/src/main/java/org/springframework/data/redis/serializer/RedisSerializationContext.java b/src/main/java/org/springframework/data/redis/serializer/RedisSerializationContext.java index c7ce7058a..db286252a 100644 --- a/src/main/java/org/springframework/data/redis/serializer/RedisSerializationContext.java +++ b/src/main/java/org/springframework/data/redis/serializer/RedisSerializationContext.java @@ -55,7 +55,7 @@ public interface RedisSerializationContext { */ static RedisSerializationContextBuilder newSerializationContext(RedisSerializer defaultSerializer) { - Assert.notNull(defaultSerializer, "DefaultSerializer must not be null!"); + Assert.notNull(defaultSerializer, "DefaultSerializer must not be null"); return newSerializationContext(SerializationPair.fromSerializer(defaultSerializer)); } @@ -71,7 +71,7 @@ public interface RedisSerializationContext { @SuppressWarnings("unchecked") static RedisSerializationContextBuilder newSerializationContext(SerializationPair serializationPair) { - Assert.notNull(serializationPair, "SerializationPair must not be null!"); + Assert.notNull(serializationPair, "SerializationPair must not be null"); return new DefaultRedisSerializationContext.DefaultRedisSerializationContextBuilder() // .key(serializationPair).value(serializationPair) // @@ -205,7 +205,7 @@ public interface RedisSerializationContext { */ static SerializationPair fromSerializer(RedisSerializer serializer) { - Assert.notNull(serializer, "RedisSerializer must not be null!"); + Assert.notNull(serializer, "RedisSerializer must not be null"); return new RedisSerializerToSerializationPairAdapter<>(serializer); } @@ -220,8 +220,8 @@ public interface RedisSerializationContext { static SerializationPair just(RedisElementReader reader, RedisElementWriter writer) { - Assert.notNull(reader, "RedisElementReader must not be null!"); - Assert.notNull(writer, "RedisElementWriter must not be null!"); + Assert.notNull(reader, "RedisElementReader must not be null"); + Assert.notNull(writer, "RedisElementWriter must not be null"); return new DefaultSerializationPair<>(reader, writer); } diff --git a/src/main/java/org/springframework/data/redis/serializer/RedisSerializerToSerializationPairAdapter.java b/src/main/java/org/springframework/data/redis/serializer/RedisSerializerToSerializationPairAdapter.java index 66b160d49..b00471411 100644 --- a/src/main/java/org/springframework/data/redis/serializer/RedisSerializerToSerializationPairAdapter.java +++ b/src/main/java/org/springframework/data/redis/serializer/RedisSerializerToSerializationPairAdapter.java @@ -78,7 +78,7 @@ class RedisSerializerToSerializationPairAdapter implements SerializationPair< */ public static SerializationPair from(RedisSerializer redisSerializer) { - Assert.notNull(redisSerializer, "RedisSerializer must not be null!"); + Assert.notNull(redisSerializer, "RedisSerializer must not be null"); return new RedisSerializerToSerializationPairAdapter<>(redisSerializer); } diff --git a/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java index c91bf44ac..61c8746d8 100644 --- a/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java @@ -76,7 +76,7 @@ public class StringRedisSerializer implements RedisSerializer { */ public StringRedisSerializer(Charset charset) { - Assert.notNull(charset, "Charset must not be null!"); + Assert.notNull(charset, "Charset must not be null"); this.charset = charset; } diff --git a/src/main/java/org/springframework/data/redis/stream/DefaultStreamMessageListenerContainer.java b/src/main/java/org/springframework/data/redis/stream/DefaultStreamMessageListenerContainer.java index 4395c99d1..957d60761 100644 --- a/src/main/java/org/springframework/data/redis/stream/DefaultStreamMessageListenerContainer.java +++ b/src/main/java/org/springframework/data/redis/stream/DefaultStreamMessageListenerContainer.java @@ -76,8 +76,8 @@ class DefaultStreamMessageListenerContainer> implement DefaultStreamMessageListenerContainer(RedisConnectionFactory connectionFactory, StreamMessageListenerContainerOptions containerOptions) { - Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null!"); - Assert.notNull(containerOptions, "StreamMessageListenerContainerOptions must not be null!"); + Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null"); + Assert.notNull(containerOptions, "StreamMessageListenerContainerOptions must not be null"); this.taskExecutor = containerOptions.getExecutor(); this.errorHandler = containerOptions.getErrorHandler(); @@ -337,7 +337,7 @@ class DefaultStreamMessageListenerContainer> implement public void handleError(Throwable t) { if (this.logger.isErrorEnabled()) { - this.logger.error("Unexpected error occurred in scheduled task.", t); + this.logger.error("Unexpected error occurred in scheduled task", t); } } } diff --git a/src/main/java/org/springframework/data/redis/stream/DefaultStreamReceiver.java b/src/main/java/org/springframework/data/redis/stream/DefaultStreamReceiver.java index 423bc6b30..3a4f4c57b 100644 --- a/src/main/java/org/springframework/data/redis/stream/DefaultStreamReceiver.java +++ b/src/main/java/org/springframework/data/redis/stream/DefaultStreamReceiver.java @@ -291,7 +291,7 @@ class DefaultStreamReceiver> implements StreamReceiver if (logger.isDebugEnabled()) { logger.debug(String - .format("[stream: %s] scheduleIfRequired(): Subscriber has no demand. Suspending subscription.", key)); + .format("[stream: %s] scheduleIfRequired(): Subscriber has no demand; Suspending subscription", key)); } return; } diff --git a/src/main/java/org/springframework/data/redis/stream/StreamMessageListenerContainer.java b/src/main/java/org/springframework/data/redis/stream/StreamMessageListenerContainer.java index 99991b83f..a48a755c7 100644 --- a/src/main/java/org/springframework/data/redis/stream/StreamMessageListenerContainer.java +++ b/src/main/java/org/springframework/data/redis/stream/StreamMessageListenerContainer.java @@ -131,7 +131,7 @@ public interface StreamMessageListenerContainer> exten static StreamMessageListenerContainer> create( RedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null"); return create(connectionFactory, StreamMessageListenerContainerOptions.builder().serializer(StringRedisSerializer.UTF_8).build()); @@ -148,8 +148,8 @@ public interface StreamMessageListenerContainer> exten static > StreamMessageListenerContainer create( RedisConnectionFactory connectionFactory, StreamMessageListenerContainerOptions options) { - Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null!"); - Assert.notNull(options, "StreamMessageListenerContainerOptions must not be null!"); + Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null"); + Assert.notNull(options, "StreamMessageListenerContainerOptions must not be null"); return new DefaultStreamMessageListenerContainer<>(connectionFactory, options); } @@ -612,8 +612,8 @@ public interface StreamMessageListenerContainer> exten */ public StreamMessageListenerContainerOptionsBuilder pollTimeout(Duration pollTimeout) { - Assert.notNull(pollTimeout, "Poll timeout must not be null!"); - Assert.isTrue(!pollTimeout.isNegative(), "Poll timeout must not be negative!"); + Assert.notNull(pollTimeout, "Poll timeout must not be null"); + Assert.isTrue(!pollTimeout.isNegative(), "Poll timeout must not be negative"); this.pollTimeout = pollTimeout; return this; @@ -627,7 +627,7 @@ public interface StreamMessageListenerContainer> exten */ public StreamMessageListenerContainerOptionsBuilder batchSize(int messagesPerPoll) { - Assert.isTrue(messagesPerPoll > 0, "Batch size must be greater zero!"); + Assert.isTrue(messagesPerPoll > 0, "Batch size must be greater zero"); this.batchSize = messagesPerPoll; return this; @@ -641,7 +641,7 @@ public interface StreamMessageListenerContainer> exten */ public StreamMessageListenerContainerOptionsBuilder executor(Executor executor) { - Assert.notNull(executor, "Executor must not be null!"); + Assert.notNull(executor, "Executor must not be null"); this.executor = executor; return this; @@ -655,7 +655,7 @@ public interface StreamMessageListenerContainer> exten */ public StreamMessageListenerContainerOptionsBuilder errorHandler(ErrorHandler errorHandler) { - Assert.notNull(errorHandler, "ErrorHandler must not be null!"); + Assert.notNull(errorHandler, "ErrorHandler must not be null"); this.errorHandler = errorHandler; return this; diff --git a/src/main/java/org/springframework/data/redis/stream/StreamReceiver.java b/src/main/java/org/springframework/data/redis/stream/StreamReceiver.java index 3b878f150..b96a089a0 100644 --- a/src/main/java/org/springframework/data/redis/stream/StreamReceiver.java +++ b/src/main/java/org/springframework/data/redis/stream/StreamReceiver.java @@ -118,7 +118,7 @@ public interface StreamReceiver> { static StreamReceiver> create( ReactiveRedisConnectionFactory connectionFactory) { - Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null!"); + Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null"); SerializationPair serializationPair = SerializationPair.fromSerializer(StringRedisSerializer.UTF_8); return create(connectionFactory, StreamReceiverOptions.builder().serializer(serializationPair).build()); @@ -134,8 +134,8 @@ public interface StreamReceiver> { static > StreamReceiver create(ReactiveRedisConnectionFactory connectionFactory, StreamReceiverOptions options) { - Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null!"); - Assert.notNull(options, "StreamReceiverOptions must not be null!"); + Assert.notNull(connectionFactory, "ReactiveRedisConnectionFactory must not be null"); + Assert.notNull(options, "StreamReceiverOptions must not be null"); return new DefaultStreamReceiver<>(connectionFactory, options); } @@ -331,8 +331,8 @@ public interface StreamReceiver> { */ public StreamReceiverOptionsBuilder pollTimeout(Duration pollTimeout) { - Assert.notNull(pollTimeout, "Poll timeout must not be null!"); - Assert.isTrue(!pollTimeout.isNegative(), "Poll timeout must not be negative!"); + Assert.notNull(pollTimeout, "Poll timeout must not be null"); + Assert.isTrue(!pollTimeout.isNegative(), "Poll timeout must not be negative"); this.pollTimeout = pollTimeout; return this; @@ -346,7 +346,7 @@ public interface StreamReceiver> { */ public StreamReceiverOptionsBuilder batchSize(int recordsPerPoll) { - Assert.isTrue(recordsPerPoll > 0, "Batch size must be greater zero!"); + Assert.isTrue(recordsPerPoll > 0, "Batch size must be greater zero"); this.batchSize = recordsPerPoll; return this; diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java index 220f5b692..2991eafec 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java @@ -162,7 +162,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO return value; } - throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key)); + throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist", key)); } /** @@ -238,7 +238,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO */ public double getAndUpdate(DoubleUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); double previousValue, newValue; @@ -263,7 +263,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO */ public double getAndAccumulate(double updateValue, DoubleBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); double previousValue, newValue; @@ -314,7 +314,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO */ public double updateAndGet(DoubleUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); double previousValue, newValue; @@ -339,7 +339,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO */ public double accumulateAndGet(double updateValue, DoubleBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); double previousValue, newValue; diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java index 4d708cf8b..a557b6023 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java @@ -162,7 +162,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey return value; } - throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key)); + throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist", key)); } /** @@ -238,7 +238,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey */ public int getAndUpdate(IntUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); int previousValue, newValue; @@ -263,7 +263,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey */ public int getAndAccumulate(int updateValue, IntBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); int previousValue, newValue; @@ -314,7 +314,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey */ public int updateAndGet(IntUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); int previousValue, newValue; @@ -339,7 +339,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey */ public int accumulateAndGet(int updateValue, IntBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); int previousValue, newValue; diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java index e1292712c..f2d7c54bd 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java @@ -163,7 +163,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe return value; } - throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key)); + throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist", key)); } /** @@ -238,7 +238,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe */ public long getAndUpdate(LongUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); long previousValue, newValue; @@ -262,7 +262,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe */ public long getAndAccumulate(long updateValue, LongBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); long previousValue, newValue; @@ -312,7 +312,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe */ public long updateAndGet(LongUnaryOperator updateFunction) { - Assert.notNull(updateFunction, "Update function must not be null!"); + Assert.notNull(updateFunction, "Update function must not be null"); long previousValue, newValue; @@ -336,7 +336,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe */ public long accumulateAndGet(long updateValue, LongBinaryOperator accumulatorFunction) { - Assert.notNull(accumulatorFunction, "Accumulator function must not be null!"); + Assert.notNull(accumulatorFunction, "Accumulator function must not be null"); long previousValue, newValue; diff --git a/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java index 84af76688..e9122fa81 100644 --- a/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java +++ b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java @@ -48,8 +48,8 @@ public abstract class AbstractRedisCollection extends AbstractCollection i */ public AbstractRedisCollection(String key, RedisOperations operations) { - Assert.hasText(key, "Key must not be empty!"); - Assert.notNull(operations, "RedisOperations must not be null!"); + Assert.hasText(key, "Key must not be empty"); + Assert.notNull(operations, "RedisOperations must not be null"); this.key = key; this.operations = operations; diff --git a/src/main/java/org/springframework/data/redis/util/ByteUtils.java b/src/main/java/org/springframework/data/redis/util/ByteUtils.java index d4a08a073..63b3571b1 100644 --- a/src/main/java/org/springframework/data/redis/util/ByteUtils.java +++ b/src/main/java/org/springframework/data/redis/util/ByteUtils.java @@ -138,7 +138,7 @@ public final class ByteUtils { */ public static byte[] getBytes(ByteBuffer byteBuffer) { - Assert.notNull(byteBuffer, "ByteBuffer must not be null!"); + Assert.notNull(byteBuffer, "ByteBuffer must not be null"); ByteBuffer duplicate = byteBuffer.duplicate(); byte[] bytes = new byte[duplicate.remaining()]; @@ -228,8 +228,8 @@ public final class ByteUtils { */ public static ByteBuffer getByteBuffer(String theString, Charset charset) { - Assert.notNull(theString, "The String must not be null!"); - Assert.notNull(charset, "The String must not be null!"); + Assert.notNull(theString, "The String must not be null"); + Assert.notNull(charset, "The String must not be null"); return charset.encode(theString); } diff --git a/src/test/java/org/springframework/data/redis/cache/LegacyRedisCacheTests.java b/src/test/java/org/springframework/data/redis/cache/LegacyRedisCacheTests.java index d0dd57b95..e95c721d9 100644 --- a/src/test/java/org/springframework/data/redis/cache/LegacyRedisCacheTests.java +++ b/src/test/java/org/springframework/data/redis/cache/LegacyRedisCacheTests.java @@ -354,7 +354,7 @@ public class LegacyRedisCacheTests { assertThatExceptionOfType(ValueRetrievalException.class).isThrownBy(() -> { cache.get(key, () -> { - throw new RuntimeException("doh!"); + throw new RuntimeException("doh"); }); }); } @@ -362,7 +362,7 @@ public class LegacyRedisCacheTests { @ParameterizedRedisTest // DATAREDIS-553 void testCacheGetSynchronizedNullWithStoredNull() { - assumeThat(allowCacheNullValues).as("Only suitable when cache does allow null values.").isTrue(); + assumeThat(allowCacheNullValues).as("Only suitable when cache does allow null values").isTrue(); Object key = getKey(); cache.put(key, null); diff --git a/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java b/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java index c836bd01f..8a97b3c64 100644 --- a/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java +++ b/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java @@ -308,7 +308,7 @@ public class RedisCacheTests { doWithConnection(connection -> connection.set(binaryCacheKey, binaryNullValue)); cache.get(key, () -> { - throw new IllegalStateException("Why call the value loader when we've got a cache entry?"); + throw new IllegalStateException("Why call the value loader when we've got a cache entry"); }); doWithConnection(connection -> { diff --git a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java index c82c03d09..a05f0d42d 100644 --- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -1126,7 +1126,7 @@ public abstract class AbstractConnectionIntegrationTests { @Test // DATAREDIS-693 void unlinkReturnsNrOfKeysRemoved() { - actual.add(connection.set("unlink.this", "Can't track this!")); + actual.add(connection.set("unlink.this", "Can't track this")); actual.add(connection.unlink("unlink.this", "unlink.that")); @@ -2596,7 +2596,7 @@ public abstract class AbstractConnectionIntegrationTests { } if (connection.isPipelined() || connection.isQueueing()) { - throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode."); + throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode"); } connection.set("spring", "data"); @@ -2623,7 +2623,7 @@ public abstract class AbstractConnectionIntegrationTests { void scanWithType() { assumeThat(connection.isPipelined() || connection.isQueueing()) - .describedAs("SCAN is only available in non pipeline | queue mode.").isFalse(); + .describedAs("SCAN is only available in non pipeline | queue mode").isFalse(); connection.set("key", "data"); connection.lPush("list", "foo"); @@ -2670,7 +2670,7 @@ public abstract class AbstractConnectionIntegrationTests { } if (connection.isPipelined() || connection.isQueueing()) { - throw new AssumptionViolatedException("ZSCAN is only available in non pipeline | queue mode."); + throw new AssumptionViolatedException("ZSCAN is only available in non pipeline | queue mode"); } connection.zAdd("myset", 2, "Bob"); @@ -2701,7 +2701,7 @@ public abstract class AbstractConnectionIntegrationTests { } if (connection.isPipelined() || connection.isQueueing()) { - throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode."); + throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode"); } connection.sAdd("sscankey", "bar"); @@ -2726,7 +2726,7 @@ public abstract class AbstractConnectionIntegrationTests { } if (connection.isPipelined() || connection.isQueueing()) { - throw new AssumptionViolatedException("HSCAN is only available in non pipeline | queue mode."); + throw new AssumptionViolatedException("HSCAN is only available in non pipeline | queue mode"); } connection.hSet("hscankey", "bar", "foobar"); @@ -3422,7 +3422,7 @@ public abstract class AbstractConnectionIntegrationTests { @Test // DATAREDIS-694 void touchReturnsNrOfKeysTouched() { - actual.add(connection.set("touch.this", "Can't touch this! - oh-oh oh oh oh-oh-oh")); + actual.add(connection.set("touch.this", "Can't touch this; - oh-oh oh oh oh-oh-oh")); actual.add(connection.touch("touch.this", "touch.that")); verifyResults(Arrays.asList(new Object[] { Boolean.TRUE, 1L })); diff --git a/src/test/java/org/springframework/data/redis/connection/jedis/JedisClusterConnectionTests.java b/src/test/java/org/springframework/data/redis/connection/jedis/JedisClusterConnectionTests.java index b5f71b93e..bc4d80b49 100644 --- a/src/test/java/org/springframework/data/redis/connection/jedis/JedisClusterConnectionTests.java +++ b/src/test/java/org/springframework/data/redis/connection/jedis/JedisClusterConnectionTests.java @@ -1152,9 +1152,9 @@ public class JedisClusterConnectionTests implements ClusterConnectionTests { nativeConnection.rpush(KEY_1, VALUE_1, VALUE_2, "foo", "bar"); - clusterConnection.lInsert(KEY_1_BYTES, Position.AFTER, VALUE_2_BYTES, JedisConverters.toBytes("booh!")); + clusterConnection.lInsert(KEY_1_BYTES, Position.AFTER, VALUE_2_BYTES, JedisConverters.toBytes("booh")); - assertThat(nativeConnection.lrange(KEY_1, 0, -1).get(2)).isEqualTo("booh!"); + assertThat(nativeConnection.lrange(KEY_1, 0, -1).get(2)).isEqualTo("booh"); } @Test // GH-2039 diff --git a/src/test/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverterUnitTests.java b/src/test/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverterUnitTests.java index b57233de8..7cc5910fd 100644 --- a/src/test/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverterUnitTests.java +++ b/src/test/java/org/springframework/data/redis/connection/jedis/JedisExceptionConverterUnitTests.java @@ -63,7 +63,7 @@ class JedisExceptionConverterUnitTests { void shouldConvertMaxRedirectException() { DataAccessException converted = converter - .convert(new JedisClusterOperationException("No more cluster attempts left.")); + .convert(new JedisClusterOperationException("No more cluster attempts left")); assertThat(converted).isInstanceOf(TooManyClusterRedirectionsException.class); } diff --git a/src/test/java/org/springframework/data/redis/connection/jedis/extension/JedisConnectionFactoryExtension.java b/src/test/java/org/springframework/data/redis/connection/jedis/extension/JedisConnectionFactoryExtension.java index 0a4ce73e2..634d876cd 100644 --- a/src/test/java/org/springframework/data/redis/connection/jedis/extension/JedisConnectionFactoryExtension.java +++ b/src/test/java/org/springframework/data/redis/connection/jedis/extension/JedisConnectionFactoryExtension.java @@ -193,7 +193,7 @@ public class JedisConnectionFactoryExtension implements ParameterResolver { if (!mayClose) { throw new IllegalStateException( - "Prematurely attempted to close ManagedJedisConnectionFactory. Shutdown hook didn't run yet which means that the test run isn't finished yet. Please fix the tests so that they don't close this connection factory."); + "Prematurely attempted to close ManagedJedisConnectionFactory; Shutdown hook didn't run yet which means that the test run isn't finished yet; Please fix the tests so that they don't close this connection factory."); } super.destroy(); diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnectionTests.java b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnectionTests.java index bf9f09adc..da2621a71 100644 --- a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnectionTests.java +++ b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnectionTests.java @@ -1189,9 +1189,9 @@ public class LettuceClusterConnectionTests implements ClusterConnectionTests { nativeConnection.rpush(KEY_1, VALUE_1, VALUE_2, "foo", "bar"); - clusterConnection.lInsert(KEY_1_BYTES, Position.AFTER, VALUE_2_BYTES, LettuceConverters.toBytes("booh!")); + clusterConnection.lInsert(KEY_1_BYTES, Position.AFTER, VALUE_2_BYTES, LettuceConverters.toBytes("booh")); - assertThat(nativeConnection.lrange(KEY_1, 0, -1).get(2)).isEqualTo("booh!"); + assertThat(nativeConnection.lrange(KEY_1, 0, -1).get(2)).isEqualTo("booh"); } @Test // GH-2039 diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactoryUnitTests.java b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactoryUnitTests.java index 80b41ad02..3571f7d50 100644 --- a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactoryUnitTests.java @@ -872,7 +872,7 @@ class LettuceConnectionFactoryUnitTests { LettuceConnectionProvider connectionProviderMock = mock(LettuceConnectionProvider.class); - when(connectionProviderMock.getConnection(any())).thenThrow(new PoolException("error!")); + when(connectionProviderMock.getConnection(any())).thenThrow(new PoolException("error")); LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory() { @Override diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionUnitTests.java b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionUnitTests.java index 37940512e..a1382e911 100644 --- a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionUnitTests.java +++ b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionUnitTests.java @@ -153,7 +153,7 @@ public class LettuceConnectionUnitTests { @Test // DATAREDIS-603 void translatesUnknownExceptions() { - IllegalArgumentException exception = new IllegalArgumentException("Aw, snap!"); + IllegalArgumentException exception = new IllegalArgumentException("Aw, snap"); when(syncCommandsMock.set(any(), any())).thenThrow(exception); connection = new LettuceConnection(null, 0, clientMock, 1); @@ -165,7 +165,7 @@ public class LettuceConnectionUnitTests { @Test // DATAREDIS-603 void translatesPipelineUnknownExceptions() throws Exception { - IllegalArgumentException exception = new IllegalArgumentException("Aw, snap!"); + IllegalArgumentException exception = new IllegalArgumentException("Aw, snap"); when(asyncCommandsMock.set(any(byte[].class), any(byte[].class))).thenThrow(exception); connection = new LettuceConnection(null, 0, clientMock, 1); diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/extension/LettuceConnectionFactoryExtension.java b/src/test/java/org/springframework/data/redis/connection/lettuce/extension/LettuceConnectionFactoryExtension.java index b77737d77..9d016b32e 100644 --- a/src/test/java/org/springframework/data/redis/connection/lettuce/extension/LettuceConnectionFactoryExtension.java +++ b/src/test/java/org/springframework/data/redis/connection/lettuce/extension/LettuceConnectionFactoryExtension.java @@ -231,7 +231,7 @@ public class LettuceConnectionFactoryExtension implements ParameterResolver { if (!mayClose) { throw new IllegalStateException( - "Prematurely attempted to close ManagedLettuceConnectionFactory. Shutdown hook didn't run yet which means that the test run isn't finished yet. Please fix the tests so that they don't close this connection factory."); + "Prematurely attempted to close ManagedLettuceConnectionFactory; Shutdown hook didn't run yet which means that the test run isn't finished yet; Please fix the tests so that they don't close this connection factory."); } super.destroy(); diff --git a/src/test/java/org/springframework/data/redis/core/RedisKeyValueTemplateTests.java b/src/test/java/org/springframework/data/redis/core/RedisKeyValueTemplateTests.java index 5fdbd7ab3..d3f2a4ab3 100644 --- a/src/test/java/org/springframework/data/redis/core/RedisKeyValueTemplateTests.java +++ b/src/test/java/org/springframework/data/redis/core/RedisKeyValueTemplateTests.java @@ -251,14 +251,14 @@ public class RedisKeyValueTemplateTests { template.insert(source); PartialUpdate update = new PartialUpdate<>(source.id, VariousTypes.class) // - .set("stringValue", "hooya!"); + .set("stringValue", "hooya"); template.doPartialUpdate(update); nativeTemplate.execute((RedisCallback) connection -> { assertThat(connection.hGet(("template-test-type-mapping:" + source.id).getBytes(), "stringValue".getBytes())) - .isEqualTo("hooya!".getBytes()); + .isEqualTo("hooya".getBytes()); assertThat(connection.hExists(("template-test-type-mapping:" + source.id).getBytes(), "simpleTypedMap._class".getBytes())).isFalse(); return null; diff --git a/src/test/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutorUnitTests.java b/src/test/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutorUnitTests.java index ad07fbee4..d0f681f7e 100644 --- a/src/test/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutorUnitTests.java +++ b/src/test/java/org/springframework/data/redis/core/script/DefaultReactiveScriptExecutorUnitTests.java @@ -81,7 +81,7 @@ class DefaultReactiveScriptExecutorUnitTests { void executeShouldUseEvalInCaseNoSha1PresentForGivenScript() { when(scriptingCommandsMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenReturn( - Flux.error(new RedisSystemException("NOSCRIPT No matching script. Please use EVAL.", new Exception()))); + Flux.error(new RedisSystemException("NOSCRIPT No matching script; Please use EVAL.", new Exception()))); when(scriptingCommandsMock.eval(any(), any(ReturnType.class), anyInt())) .thenReturn(Flux.just(ByteBuffer.wrap("FOO".getBytes()))); @@ -96,7 +96,7 @@ class DefaultReactiveScriptExecutorUnitTests { void executeShouldThrowExceptionInCaseEvalShaFailsWithOtherThanRedisSystemException() { when(scriptingCommandsMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenReturn(Flux - .error(new UnsupportedOperationException("NOSCRIPT No matching script. Please use EVAL.", new Exception()))); + .error(new UnsupportedOperationException("NOSCRIPT No matching script; Please use EVAL.", new Exception()))); executor.execute(SCRIPT).as(StepVerifier::create).verifyError(UnsupportedOperationException.class); } diff --git a/src/test/java/org/springframework/data/redis/core/script/DefaultScriptExecutorUnitTests.java b/src/test/java/org/springframework/data/redis/core/script/DefaultScriptExecutorUnitTests.java index 26361d866..0957debf5 100644 --- a/src/test/java/org/springframework/data/redis/core/script/DefaultScriptExecutorUnitTests.java +++ b/src/test/java/org/springframework/data/redis/core/script/DefaultScriptExecutorUnitTests.java @@ -78,7 +78,7 @@ class DefaultScriptExecutorUnitTests { void excuteShouldUseEvalInCaseNoSha1PresentForGivenScript() { when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenThrow( - new RedisSystemException("NOSCRIPT No matching script. Please use EVAL.", new Exception())); + new RedisSystemException("NOSCRIPT No matching script; Please use EVAL.", new Exception())); executor.execute(SCRIPT, null); @@ -89,7 +89,7 @@ class DefaultScriptExecutorUnitTests { void excuteShouldThrowExceptionInCaseEvalShaFailsWithOtherThanRedisSystemException() { when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenThrow( - new UnsupportedOperationException("NOSCRIPT No matching script. Please use EVAL.", new Exception())); + new UnsupportedOperationException("NOSCRIPT No matching script; Please use EVAL.", new Exception())); assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> executor.execute(SCRIPT, null)); } diff --git a/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerFailureIntegrationTests.java b/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerFailureIntegrationTests.java index 40e287edf..d3a0f2cf2 100644 --- a/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerFailureIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerFailureIntegrationTests.java @@ -111,7 +111,7 @@ class RedisMessageListenerContainerFailureIntegrationTests { // interrupt thread once Executor.execute is called doAnswer(invocationOnMock -> { - throw new RedisConnectionFailureException("I want to break free!"); + throw new RedisConnectionFailureException("I want to break free"); }).when(executorMock).execute(any(Runnable.class)); container.setRecoveryBackoff(new FixedBackOff(1, 5)); diff --git a/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerUnitTests.java b/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerUnitTests.java index 8d77dd613..e971b92ae 100644 --- a/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerUnitTests.java +++ b/src/test/java/org/springframework/data/redis/listener/RedisMessageListenerContainerUnitTests.java @@ -111,7 +111,7 @@ class RedisMessageListenerContainerUnitTests { @Test // GH-2335 void containerStartShouldReportFailureOnRedisUnavailability() { - when(connectionFactoryMock.getConnection()).thenThrow(new RedisConnectionFailureException("Booh!")); + when(connectionFactoryMock.getConnection()).thenThrow(new RedisConnectionFailureException("Booh")); doAnswer(it -> { @@ -130,7 +130,7 @@ class RedisMessageListenerContainerUnitTests { @Test // GH-2335 void containerListenShouldReportFailureOnRedisUnavailability() { - when(connectionFactoryMock.getConnection()).thenThrow(new RedisConnectionFailureException("Booh!")); + when(connectionFactoryMock.getConnection()).thenThrow(new RedisConnectionFailureException("Booh")); doAnswer(it -> { diff --git a/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerUnitTests.java b/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerUnitTests.java index 4ffaf8f41..101465d79 100644 --- a/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerUnitTests.java +++ b/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerUnitTests.java @@ -150,7 +150,7 @@ class MessageListenerUnitTests { MessageListener listenerAdapter = new MessageListenerAdapter(listener) { @Override public void setDefaultListenerMethod(String defaultListenerMethod) { - throw new RuntimeException("Boom!"); + throw new RuntimeException("Boom"); } }; diff --git a/src/test/java/org/springframework/data/redis/repository/query/RedisQueryCreatorUnitTests.java b/src/test/java/org/springframework/data/redis/repository/query/RedisQueryCreatorUnitTests.java index 13978363d..f63d6dd6a 100644 --- a/src/test/java/org/springframework/data/redis/repository/query/RedisQueryCreatorUnitTests.java +++ b/src/test/java/org/springframework/data/redis/repository/query/RedisQueryCreatorUnitTests.java @@ -162,7 +162,7 @@ class RedisQueryCreatorUnitTests { SampleRepository.class.getMethod("findByLocationNear", Shape.class), new Object[] { new Point(0, 0) }); assertThatExceptionOfType(InvalidDataAccessApiUsageException.class).isThrownBy(creator::createQuery) - .withMessageContaining("Are you missing a parameter?"); + .withMessageContaining("Are you missing a parameter"); } @Test // DATAREDIS-771 diff --git a/src/test/java/org/springframework/data/redis/test/condition/EnabledOnRedisDriverCondition.java b/src/test/java/org/springframework/data/redis/test/condition/EnabledOnRedisDriverCondition.java index f1350b12a..2fe46f1d6 100644 --- a/src/test/java/org/springframework/data/redis/test/condition/EnabledOnRedisDriverCondition.java +++ b/src/test/java/org/springframework/data/redis/test/condition/EnabledOnRedisDriverCondition.java @@ -59,7 +59,7 @@ class EnabledOnRedisDriverCondition implements ExecutionCondition { if (annotatedFields.isEmpty()) { throw new IllegalStateException( - "@EnabledOnRedisDriver requires a field of type RedisConnectionFactory annotated with @DriverQualifier!"); + "@EnabledOnRedisDriver requires a field of type RedisConnectionFactory annotated with @DriverQualifier"); } for (Field field : annotatedFields) { @@ -76,7 +76,7 @@ class EnabledOnRedisDriverCondition implements ExecutionCondition { } if (!foundMatch) { - return disabled(String.format("Driver %s not supported. Supported driver(s): %s", value, + return disabled(String.format("Driver %s not supported; Supported driver(s): %s", value, Arrays.toString(annotation.value()))); } } diff --git a/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedRedisTestExtension.java b/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedRedisTestExtension.java index aa3be24fe..8f4926011 100644 --- a/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedRedisTestExtension.java +++ b/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedRedisTestExtension.java @@ -115,7 +115,7 @@ class ParameterizedRedisTestExtension implements TestTemplateInvocationContextPr return ReflectionUtils.newInstance(clazz); } catch (Exception ex) { if (ex instanceof NoSuchMethodException) { - String message = String.format("Failed to find a no-argument constructor for ArgumentsProvider [%s]. " + String message = String.format("Failed to find a no-argument constructor for ArgumentsProvider [%s]; " + "Please ensure that a no-argument constructor exists and " + "that the class is either a top-level class or a static nested class", clazz.getName()); throw new JUnitException(message, ex); diff --git a/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedTestNameFormatter.java b/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedTestNameFormatter.java index 39c7eccaa..3021d946c 100644 --- a/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedTestNameFormatter.java +++ b/src/test/java/org/springframework/data/redis/test/extension/parametrized/ParameterizedTestNameFormatter.java @@ -53,7 +53,7 @@ class ParameterizedTestNameFormatter { try { return formatSafely(invocationIndex, arguments); } catch (Exception ex) { - String message = "The display name pattern defined for the parameterized test is invalid. " + String message = "The display name pattern defined for the parameterized test is invalid; " + "See nested exception for further details."; throw new JUnitException(message, ex); } diff --git a/src/test/java/org/springframework/data/redis/test/util/HexStringUtils.java b/src/test/java/org/springframework/data/redis/test/util/HexStringUtils.java index d88e2b52c..d0412e5dc 100644 --- a/src/test/java/org/springframework/data/redis/test/util/HexStringUtils.java +++ b/src/test/java/org/springframework/data/redis/test/util/HexStringUtils.java @@ -33,7 +33,7 @@ public class HexStringUtils { */ public static byte[] hexToBytes(String source) { - Assert.notNull(source, "Source must not be null!"); + Assert.notNull(source, "Source must not be null"); int len = source.length(); byte[] data = new byte[len / 2];