Remove punctuation from Exception messages.

Closes #2340.
This commit is contained in:
John Blum
2022-06-08 14:01:34 -07:00
parent 73fff10237
commit c0821be37f
243 changed files with 3139 additions and 3139 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -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 -> {

View File

@@ -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) {

View File

@@ -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<String> 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);

View File

@@ -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<String> 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<String, RedisCacheConfiguration> 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;

View File

@@ -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);
}

View File

@@ -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());
}
}

View File

@@ -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)) {

View File

@@ -46,7 +46,7 @@ public class BitFieldSubCommands implements Iterable<BitFieldSubCommand> {
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<BitFieldSubCommand> {
*/
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<BitFieldSubCommand> {
*/
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<BitFieldSubCommand> {
*/
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;
}

View File

@@ -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 <T> NodeResult<T> executeCommandOnArbitraryNode(ClusterCommandCallback<?, T> cmd) {
Assert.notNull(cmd, "ClusterCommandCallback must not be null!");
Assert.notNull(cmd, "ClusterCommandCallback must not be null");
List<RedisClusterNode> 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 <S, T> NodeResult<T> executeCommandOnSingleNode(ClusterCommandCallback<S, T> 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 <S, T> MultiNodeResult<T> executeCommandAsyncOnNodes(ClusterCommandCallback<S, T> callback,
Iterable<RedisClusterNode> 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<RedisClusterNode> resolvedRedisClusterNodes = new ArrayList<>();
ClusterTopology topology = topologyProvider.getTopology();
@@ -305,12 +305,12 @@ public class ClusterCommandExecutor implements DisposableBean {
private <S, T> NodeResult<T> executeMultiKeyCommandOnSingleNode(MultiKeyClusterCommandCallback<S, T> 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> U mapValue(Function<? super T, ? extends U> mapper) {
Assert.notNull(mapper, "Mapper function must not be null!");
Assert.notNull(mapper, "Mapper function must not be null");
return mapper.apply(getValue());
}

View File

@@ -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);
}

View File

@@ -64,7 +64,7 @@ public final class ClusterSlotHashUtil {
*/
public static boolean isSameSlotForAllKeys(Collection<ByteBuffer> 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);

View File

@@ -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));
}
/**

View File

@@ -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;

View File

@@ -2271,7 +2271,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco
@Override
public Long geoAdd(String key, GeoLocation<String> 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<String, Point> memberCoordinateMap) {
Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null!");
Assert.notNull(memberCoordinateMap, "MemberCoordinateMap must not be null");
Map<byte[], Point> byteMap = new HashMap<>();
for (Entry<String, Point> entry : memberCoordinateMap.entrySet()) {
@@ -2301,7 +2301,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection, Deco
@Override
public Long geoAdd(String key, Iterable<GeoLocation<String>> locations) {
Assert.notNull(locations, "Locations must not be null!");
Assert.notNull(locations, "Locations must not be null");
Map<byte[], Point> byteMap = new HashMap<>();
for (GeoLocation<String> 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<Object> convertedResults = new ArrayList<>(results.size());

View File

@@ -80,7 +80,7 @@ public interface ReactiveGeoCommands {
*/
public static GeoAddCommand location(GeoLocation<ByteBuffer> 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<GeoLocation<ByteBuffer>> 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<Long> 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<Long> geoAdd(ByteBuffer key, GeoLocation<ByteBuffer> 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<Long> geoAdd(ByteBuffer key, Collection<GeoLocation<ByteBuffer>> 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<Distance> 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<ByteBuffer> 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<String> 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<List<String>> geoHash(ByteBuffer key, Collection<ByteBuffer> 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<ByteBuffer> 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<Point> 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<List<Point>> geoPos(ByteBuffer key, Collection<ByteBuffer> 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<GeoResult<GeoLocation<ByteBuffer>>> 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<GeoResult<GeoLocation<ByteBuffer>>> 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<ByteBuffer> 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<ByteBuffer> 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);
}

View File

@@ -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<ByteBuffer, ByteBuffer> 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<Boolean> 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<Boolean> 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<Boolean> hMSet(ByteBuffer key, Map<ByteBuffer, ByteBuffer> 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<ByteBuffer> 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<List<ByteBuffer>> hMGet(ByteBuffer key, Collection<ByteBuffer> 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<Boolean> 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<ByteBuffer> 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<Boolean> 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<Long> hDel(ByteBuffer key, Collection<ByteBuffer> 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<Long> 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<ByteBuffer> 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<Map.Entry<ByteBuffer, ByteBuffer>> 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<ByteBuffer> 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<Map.Entry<ByteBuffer, ByteBuffer>> 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<ByteBuffer> 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<ByteBuffer> 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<Map.Entry<ByteBuffer, ByteBuffer>> 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<Long> 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);
}

View File

@@ -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<ByteBuffer> 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<Long> 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<Long> pfAdd(ByteBuffer key, Collection<ByteBuffer> 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<ByteBuffer> 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<Long> 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<Long> pfCount(Collection<ByteBuffer> 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<ByteBuffer> 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<Boolean> pfMerge(ByteBuffer destinationKey, Collection<ByteBuffer> 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);

View File

@@ -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<Boolean> 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<Boolean> 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<DataType> 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<List<ByteBuffer>> 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<Boolean> 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<Boolean> 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<Long> 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<Long> mDel(List<ByteBuffer> 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<Long> 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<Long> mUnlink(List<ByteBuffer> 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<Boolean> 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<Boolean> 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<Boolean> 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<Boolean> 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<Boolean> 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<Long> 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<Long> 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<Boolean> 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);
}

View File

@@ -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<ByteBuffer> 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<Long> rPush(ByteBuffer key, List<ByteBuffer> 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<Long> 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<Long> lPush(ByteBuffer key, List<ByteBuffer> 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<Long> 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<Long> 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<ByteBuffer> 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<Boolean> 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<Long> 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<ByteBuffer> 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<Long> 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<ByteBuffer> 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<ByteBuffer> 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<Boolean> 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<Long> 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<Long> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<PopResult> blPop(List<ByteBuffer> 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<PopResult> brPop(List<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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);

View File

@@ -44,7 +44,7 @@ public interface ReactiveNumberCommands {
*/
default Mono<Long> 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 <T extends Number> IncrByCommand<T> 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<T> 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 <T extends Number> Mono<T> 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.<T> incr(key).by(value))).next().map(NumericResponse::getOutput);
}
@@ -161,7 +161,7 @@ public interface ReactiveNumberCommands {
*/
public static <T extends Number> DecrByCommand<T> 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<T> 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<Long> 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 <T extends Number> Mono<T> 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.<T> decr(key).by(value))).next().map(NumericResponse::getOutput);
}
@@ -263,7 +263,7 @@ public interface ReactiveNumberCommands {
*/
public static <T extends Number> HIncrByCommand<T> 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<T> 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<T> 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 <T extends Number> Mono<T> 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.<T> incr(field).by(value).forKey(key))).next()
.map(NumericResponse::getOutput);

View File

@@ -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<Long> range) {
Assert.notNull(range, "Range must not be null!");
Assert.notNull(range, "Range must not be null");
return new RangeCommand(getKey(), range);
}

View File

@@ -65,7 +65,7 @@ public interface ReactiveScriptingCommands {
*/
default Mono<Boolean> 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();
}

View File

@@ -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<ByteBuffer> 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<Long> 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<Long> sAdd(ByteBuffer key, Collection<ByteBuffer> 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<ByteBuffer> 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<Long> 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<Long> sRem(ByteBuffer key, Collection<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<Boolean> 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<Long> 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<Boolean> 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<ByteBuffer> 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<List<Boolean>> sMIsMember(ByteBuffer key, List<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> sInter(Collection<ByteBuffer> 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<ByteBuffer> 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<Long> sInterStore(ByteBuffer destinationKey, Collection<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> sUnion(Collection<ByteBuffer> 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<ByteBuffer> 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<Long> sUnionStore(ByteBuffer destinationKey, Collection<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> sDiff(Collection<ByteBuffer> 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<ByteBuffer> 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<Long> sDiffStore(ByteBuffer destinationKey, Collection<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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);
}

View File

@@ -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<RecordId> 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<Long> 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<Long> 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<ByteBuffer, ByteBuffer> 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<RecordId> xAdd(ByteBuffer key, Map<ByteBuffer, ByteBuffer> 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<RecordId> 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<RecordId> newrecordIds = new ArrayList<>(getRecordIds().size() + recordIds.length);
newrecordIds.addAll(getRecordIds());
@@ -584,8 +584,8 @@ public interface ReactiveStreamCommands {
*/
default Mono<Long> 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<Long> 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<Long> 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<PendingMessagesSummary> 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<String> 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<ByteBufferRecord> xRange(ByteBuffer key, Range<String> 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<ByteBuffer> 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<ByteBuffer>... 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<ByteBufferRecord> xRead(StreamReadOptions readOptions, StreamOffset<ByteBuffer>... 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<ByteBufferRecord> xReadGroup(Consumer consumer, StreamReadOptions readOptions,
StreamOffset<ByteBuffer>... 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<ByteBufferRecord> xRevRange(ByteBuffer key, Range<String> 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<Long> 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);

View File

@@ -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<Boolean> 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<Boolean> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<List<ByteBuffer>> mGet(List<ByteBuffer> 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<Boolean> 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<Boolean> 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<Boolean> 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<ByteBuffer, ByteBuffer> 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<Boolean> mSet(Map<ByteBuffer, ByteBuffer> 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<Boolean> mSetNX(Map<ByteBuffer, ByteBuffer> 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<Long> 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<ByteBuffer> 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<Long> 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<Boolean> 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<Boolean> 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<Long> 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<Long> 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<Long> 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<List<Long>> 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<ByteBuffer> 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<Long> bitOp(Collection<ByteBuffer> 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<Long> 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);
}

View File

@@ -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;
}

View File

@@ -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<? extends Tuple> 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<Long> 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<Long> zAdd(ByteBuffer key, Collection<? extends Tuple> 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<ByteBuffer> 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<Long> 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<Long> zRem(ByteBuffer key, Collection<ByteBuffer> 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<Double> 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<Long> 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<Long> 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<Long> 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<Long> 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<ByteBuffer> zRange(ByteBuffer key, Range<Long> 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<Tuple> zRangeWithScores(ByteBuffer key, Range<Long> 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<ByteBuffer> zRevRange(ByteBuffer key, Range<Long> 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<Tuple> zRevRangeWithScores(ByteBuffer key, Range<Long> 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<Double> 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<Double> 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<ByteBuffer> zRangeByScore(ByteBuffer key, Range<Double> 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<ByteBuffer> zRangeByScore(ByteBuffer key, Range<Double> 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<Tuple> zRangeByScoreWithScores(ByteBuffer key, Range<Double> 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<Tuple> zRangeByScoreWithScores(ByteBuffer key, Range<Double> 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<ByteBuffer> zRevRangeByScore(ByteBuffer key, Range<Double> 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<ByteBuffer> zRevRangeByScore(ByteBuffer key, Range<Double> 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<Tuple> zRevRangeByScoreWithScores(ByteBuffer key, Range<Double> 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<Tuple> zRevRangeByScoreWithScores(ByteBuffer key, Range<Double> 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<Double> 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<Long> zCount(ByteBuffer key, Range<Double> 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<String> 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<Long> 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<Double> 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<ByteBuffer> 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<List<Double>> zMScore(ByteBuffer key, Collection<ByteBuffer> 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<Long> 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<Long> zRemRangeByRank(ByteBuffer key, Range<Long> 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<Long> zRemRangeByScore(ByteBuffer key, Range<Double> 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<Long> zRemRangeByLex(ByteBuffer key, Range<String> 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<ByteBuffer> 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<ByteBuffer> 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<Long> zDiffStore(ByteBuffer destinationKey, List<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> 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<ByteBuffer> zInter(List<ByteBuffer> 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<Tuple> zInterWithScores(List<ByteBuffer> sets, List<Double> 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<Tuple> zInterWithScores(List<ByteBuffer> 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<ByteBuffer> 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<Long> zInterStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> 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<Long> zInterStore(ByteBuffer destinationKey, List<ByteBuffer> 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<ByteBuffer> zUnion(List<ByteBuffer> 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<Tuple> zUnionWithScores(List<ByteBuffer> sets, List<Double> 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<Tuple> zUnionWithScores(List<ByteBuffer> 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<ByteBuffer> 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<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> sets, List<Double> 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<Long> zUnionStore(ByteBuffer destinationKey, List<ByteBuffer> 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<String> 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<String> 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<ByteBuffer> zRangeByLex(ByteBuffer key, Range<String> 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<ByteBuffer> zRevRangeByLex(ByteBuffer key, Range<String> 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);

View File

@@ -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<RedisNode> 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<String, Object> asMap(Collection<String> 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<String, Object> map = new HashMap<>();
map.put(REDIS_CLUSTER_NODES_CONFIG_PROPERTY, StringUtils.collectionToCommaDelimitedString(clusterHostAndPorts));

View File

@@ -93,9 +93,9 @@ public interface RedisClusterConnection
@Nullable
default <T> T execute(String command, byte[] key, Collection<byte[]> 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][];

View File

@@ -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++) {

View File

@@ -130,7 +130,7 @@ public interface RedisConfiguration {
*/
static Integer getDatabaseOrElse(@Nullable RedisConfiguration configuration, Supplier<Integer> 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<String> 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<RedisPassword> 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<String> 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));
}

View File

@@ -67,8 +67,8 @@ public interface RedisGeoCommands {
@Nullable
default Long geoAdd(byte[] key, GeoLocation<byte[]> 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());

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -117,7 +117,7 @@ public class RedisPassword {
*/
public <R> Optional<R> map(Function<char[], R> mapper) {
Assert.notNull(mapper, "Mapper function must not be null!");
Assert.notNull(mapper, "Mapper function must not be null");
return toOptional().map(mapper);
}

View File

@@ -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<RedisNode> 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<String, Object> asMap(String master, Set<String> 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<String, Object> map = new HashMap<>();
map.put(REDIS_SENTINEL_MASTER_CONFIG_PROPERTY, master);

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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));

View File

@@ -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;
}

View File

@@ -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<String> 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<Flag> flags = parseFlags(args);

View File

@@ -40,7 +40,7 @@ public class SetConverter<S, T> implements Converter<Set<S>, Set<T>> {
*/
public SetConverter(Converter<S, T> itemConverter) {
Assert.notNull(itemConverter, "ItemConverter must not be null!");
Assert.notNull(itemConverter, "ItemConverter must not be null");
this.itemConverter = itemConverter;
}

View File

@@ -51,7 +51,7 @@ public class TransactionResultConverter<T> implements Converter<List<Object>, 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<Object> convertedResults = new ArrayList<>();
@@ -63,7 +63,7 @@ public class TransactionResultConverter<T> implements Converter<List<Object>, 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);

View File

@@ -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;

View File

@@ -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<Object>) client -> client.sendCommand(JedisClientUtils.getCommand(command), args))
@@ -176,9 +176,9 @@ public class JedisClusterConnection implements RedisClusterConnection {
@Override
public <T> T execute(String command, byte[] key, Collection<byte[]> 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 <T> List<T> execute(String command, Collection<byte[]> keys, Collection<byte[]> 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<T>) (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<Object> 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<String>) client -> client.clusterMeet(node.getHost(), node.getPort()));
@@ -572,7 +572,7 @@ public class JedisClusterConnection implements RedisClusterConnection {
@Override
public Set<RedisClusterNode> 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<Object> 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());
}
/**

View File

@@ -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<byte[], Point> 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<byte[], GeoCoordinate> redisGeoCoordinateMap = new HashMap<>();
for (byte[] mapKey : memberCoordinateMap.keySet()) {
@@ -85,8 +85,8 @@ class JedisClusterGeoCommands implements RedisGeoCommands {
@Override
public Long geoAdd(byte[] key, Iterable<GeoLocation<byte[]>> 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<byte[], redis.clients.jedis.GeoCoordinate> redisGeoCoordinateMap = new HashMap<>();
for (GeoLocation<byte[]> 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<String> 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<Point> 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<GeoLocation<byte[]>> 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<GeoLocation<byte[]>> 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<GeoLocation<byte[]>> 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<GeoLocation<byte[]>> 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<GeoLocation<byte[]>> geoSearch(byte[] key, GeoReference<byte[]> 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<byte[]> 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 {

View File

@@ -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<byte[]> 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<byte[], byte[]> 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<byte[], byte[]> hRandFieldWithValues(byte[] key) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
try {
Map<byte[], byte[]> map = connection.getCluster().hrandfieldWithValues(key, 1);
@@ -172,7 +172,7 @@ class JedisClusterHashCommands implements RedisHashCommands {
@Override
public List<byte[]> 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<byte[]> 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<byte[]> 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<byte[], byte[]> 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<Entry<byte[], byte[]>> hScan(byte[] key, ScanOptions options) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
return new ScanCursor<Entry<byte[], byte[]>>(options) {

View File

@@ -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) {

View File

@@ -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.<Long> 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.<Long> execute("TOUCH", Arrays.asList(keys), Collections.emptyList()).stream()
.mapToLong(val -> val).sum();
@@ -130,7 +130,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
@Override
public Set<byte[]> keys(byte[] pattern) {
Assert.notNull(pattern, "Pattern must not be null!");
Assert.notNull(pattern, "Pattern must not be null");
Collection<Set<byte[]>> keysPerNode = connection.getClusterCommandExecutor()
.executeCommandOnAllNodes((JedisClusterCommandCallback<Set<byte[]>>) client -> client.keys(pattern))
@@ -145,8 +145,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
public Set<byte[]> 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<Set<byte[]>>) client -> client.keys(pattern), node)
@@ -168,8 +168,8 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
*/
Cursor<byte[]> 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<Cursor<byte[]>>) 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<byte[]>) 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<Long>) 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<byte[]>) 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<String>) client -> {
@@ -417,7 +417,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
@Override
public List<byte[]> 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<byte[]> 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<byte[]>) 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<Long>) 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<Long>) client -> client.objectRefcount(key),

View File

@@ -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<Long> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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 {

View File

@@ -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<byte[]> multiNodeResult = connection.getClusterCommandExecutor()
@@ -79,14 +79,14 @@ class JedisClusterScriptingCommands implements RedisScriptingCommands {
@Override
public List<Boolean> 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> 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> 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)

View File

@@ -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<NodeResult<List<String>>> mapResult = connection.getClusterCommandExecutor()
.executeCommandOnAllNodes((JedisClusterCommandCallback<List<String>>) 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<String>) 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<String> 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);
}

View File

@@ -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<byte[]> 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<Boolean> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> sScan(byte[] key, ScanOptions options) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
return new ScanCursor<byte[]>(options) {

View File

@@ -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<byte[], byte[], byte[]> 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<RecordId> 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<ByteRecord> 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<String> range = (Range<String>) options.getRange();
byte[] group = JedisConverters.toBytes(groupName);
@@ -283,9 +283,9 @@ class JedisClusterStreamCommands implements RedisStreamCommands {
@Override
public List<ByteRecord> xRange(byte[] key, Range<String> 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<ByteRecord> xRead(StreamReadOptions readOptions, StreamOffset<byte[]>... 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<ByteRecord> xReadGroup(Consumer consumer, StreamReadOptions readOptions,
StreamOffset<byte[]>... 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<ByteRecord> xRevRange(byte[] key, Range<String> 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);

View File

@@ -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<byte[]> 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<byte[], byte[]> 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<byte[], byte[]> 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<Long> 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<Long> 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<byte[]> 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);

View File

@@ -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<Tuple> 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<byte[]> 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<redis.clients.jedis.resps.Tuple> tuples = connection.getCluster().zrandmemberWithScores(key, 1);
@@ -156,7 +156,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands {
@Override
public List<Tuple> zRandMemberWithScore(byte[] key, long count) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
try {
List<redis.clients.jedis.resps.Tuple> 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<byte[]> 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<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<Number> 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<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<Number> 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<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<Number> 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<Number> 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<byte[]> 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<Tuple> 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<Tuple> 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<Number> 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<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<Number> 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<byte[]> zRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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<byte[]> 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<byte[]> zRevRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<Double> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<Tuple> 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<byte[]> 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<Tuple> 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<Tuple> 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<Tuple> zScan(byte[] key, ScanOptions options) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(key, "Key must not be null");
return new ScanCursor<Tuple>(options) {
@@ -995,7 +995,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands {
@Override
public Set<byte[]> 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<byte[]> 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 {

View File

@@ -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<Object> results = transaction.exec();

View File

@@ -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<Connection> poolConfig) {
Assert.notNull(clusterConfig, "Cluster configuration must not be null!");
Assert.notNull(clusterConfig, "Cluster configuration must not be null");
Set<HostAndPort> 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);

View File

@@ -150,7 +150,7 @@ abstract class JedisConverters extends Converters {
*/
public static Map<byte[], Double> toTupleMap(Set<Tuple> tuples) {
Assert.notNull(tuples, "Tuple set must not be null!");
Assert.notNull(tuples, "Tuple set must not be null");
Map<byte[], Double> args = new LinkedHashMap<>(tuples.size(), 1);
@@ -523,10 +523,10 @@ abstract class JedisConverters extends Converters {
static Long toTime(List<String> 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<byte[]> 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();

View File

@@ -53,7 +53,7 @@ public class JedisExceptionConverter implements Converter<Exception, DataAccessE
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof JedisClusterOperationException && "No more cluster attempts left.".equals(ex.getMessage())) {
if (ex instanceof JedisClusterOperationException && "No more cluster attempts left".equals(ex.getMessage())) {
return new TooManyClusterRedirectionsException(ex.getMessage(), ex);
}

View File

@@ -52,9 +52,9 @@ class JedisGeoCommands 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(Jedis::geoadd, PipelineBinaryCommands::geoadd, key, point.getX(), point.getY(),
member);
@@ -63,8 +63,8 @@ class JedisGeoCommands implements RedisGeoCommands {
@Override
public Long geoAdd(byte[] key, Map<byte[], Point> 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<byte[], GeoCoordinate> redisGeoCoordinateMap = new HashMap<>();
@@ -78,8 +78,8 @@ class JedisGeoCommands implements RedisGeoCommands {
@Override
public Long geoAdd(byte[] key, Iterable<GeoLocation<byte[]>> 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<byte[], redis.clients.jedis.GeoCoordinate> 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<Double, Distance> 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<Double, Distance> distanceConverter = JedisConverters.distanceConverterForMetric(metric);
@@ -121,9 +121,9 @@ class JedisGeoCommands implements RedisGeoCommands {
@Override
public List<String> 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<Point> 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<GeoLocation<byte[]>> 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<List<redis.clients.jedis.resps.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
.geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric());
@@ -159,9 +159,9 @@ class JedisGeoCommands implements RedisGeoCommands {
@Override
public GeoResults<GeoLocation<byte[]>> 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<List<redis.clients.jedis.resps.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
@@ -177,9 +177,9 @@ class JedisGeoCommands implements RedisGeoCommands {
@Override
public GeoResults<GeoLocation<byte[]>> 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<List<redis.clients.jedis.resps.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
@@ -193,10 +193,10 @@ class JedisGeoCommands implements RedisGeoCommands {
public GeoResults<GeoLocation<byte[]>> 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<List<redis.clients.jedis.resps.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
@@ -216,7 +216,7 @@ class JedisGeoCommands implements RedisGeoCommands {
public GeoResults<GeoLocation<byte[]>> geoSearch(byte[] key, GeoReference<byte[]> 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<List<redis.clients.jedis.resps.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
@@ -229,8 +229,8 @@ class JedisGeoCommands implements RedisGeoCommands {
public Long geoSearchStore(byte[] destKey, byte[] key, GeoReference<byte[]> 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);

View File

@@ -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<byte[], byte[]> 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<byte[], byte[]> 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<byte[]> 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<Entry<byte[], byte[]>> 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<byte[]> 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<byte[]> 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<byte[], byte[]> 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<byte[]> 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<Entry<byte[], byte[]>> 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<Entry<byte[], byte[]>>(key, cursorId, options) {
@@ -232,7 +232,7 @@ class JedisHashCommands implements RedisHashCommands {
protected ScanIteration<Entry<byte[], byte[]>> 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);
}

View File

@@ -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);
}

View File

@@ -80,7 +80,7 @@ class JedisInvoker {
@Nullable
<R> R just(ConnectionFunction0<R> 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> R just(ConnectionFunction0<R> function, PipelineFunction0<R> 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, T1> R just(ConnectionFunction1<T1, R> function, PipelineFunction1<T1, R> 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, T1, T2> R just(ConnectionFunction2<T1, T2, R> function, PipelineFunction2<T1, T2, R> 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, T1, T2, T3> R just(ConnectionFunction3<T1, T2, T3, R> function, PipelineFunction3<T1, T2, T3, R> 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, T1, T2, T3, T4> R just(ConnectionFunction4<T1, T2, T3, T4, R> function,
PipelineFunction4<T1, T2, T3, T4, R> 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, T1, T2, T3, T4, T5> R just(ConnectionFunction5<T1, T2, T3, T4, T5, R> function,
PipelineFunction5<T1, T2, T3, T4, T5, R> 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, T1, T2, T3, T4, T5, T6> R just(ConnectionFunction6<T1, T2, T3, T4, T5, T6, R> function,
PipelineFunction6<T1, T2, T3, T4, T5, T6, R> 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 {
*/
<R> SingleInvocationSpec<R> from(ConnectionFunction0<R> 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 {
*/
<R> SingleInvocationSpec<R> from(ConnectionFunction0<R> function, PipelineFunction0<R> 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 {
<R, T1> SingleInvocationSpec<R> from(ConnectionFunction1<T1, R> function, PipelineFunction1<T1, R> 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 {
<R, T1, T2> SingleInvocationSpec<R> from(ConnectionFunction2<T1, T2, R> function,
PipelineFunction2<T1, T2, R> 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 {
<R, T1, T2, T3> SingleInvocationSpec<R> from(ConnectionFunction3<T1, T2, T3, R> function,
PipelineFunction3<T1, T2, T3, R> 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 {
<R, T1, T2, T3, T4> SingleInvocationSpec<R> from(ConnectionFunction4<T1, T2, T3, T4, R> function,
PipelineFunction4<T1, T2, T3, T4, R> 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 {
<R, T1, T2, T3, T4, T5> SingleInvocationSpec<R> from(ConnectionFunction5<T1, T2, T3, T4, T5, R> function,
PipelineFunction5<T1, T2, T3, T4, T5, R> 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 {
<R, T1, T2, T3, T4, T5, T6> SingleInvocationSpec<R> from(ConnectionFunction6<T1, T2, T3, T4, T5, T6, R> function,
PipelineFunction6<T1, T2, T3, T4, T5, T6, R> 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 {
*/
<R extends Collection<E>, E> ManyInvocationSpec<E> fromMany(ConnectionFunction0<R> 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 {
<R extends Collection<E>, E> ManyInvocationSpec<E> fromMany(ConnectionFunction0<R> function,
PipelineFunction0<R> 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<Jedis, R>) function::apply, pipelineFunction::apply, synchronizer);
}
@@ -411,8 +411,8 @@ class JedisInvoker {
<R extends Collection<E>, E, T1> ManyInvocationSpec<E> fromMany(ConnectionFunction1<T1, R> function,
PipelineFunction1<T1, R> 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 {
<R extends Collection<E>, E, T1, T2> ManyInvocationSpec<E> fromMany(ConnectionFunction2<T1, T2, R> function,
PipelineFunction2<T1, T2, R> 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 {
<R extends Collection<E>, E, T1, T2, T3> ManyInvocationSpec<E> fromMany(ConnectionFunction3<T1, T2, T3, R> function,
PipelineFunction3<T1, T2, T3, R> 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<T1, T2, T3, T4, R> function, PipelineFunction4<T1, T2, T3, T4, R> 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<T1, T2, T3, T4, T5, R> function, PipelineFunction5<T1, T2, T3, T4, T5, R> 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<T1, T2, T3, T4, T5, T6, R> function,
PipelineFunction6<T1, T2, T3, T4, T5, T6, R> 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> T getOrElse(Converter<S, T> converter, Supplier<T> 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 <T> List<T> toList(Converter<S, T> 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 <T> Set<T> toSet(Converter<S, T> converter) {
Assert.notNull(converter, "Converter must not be null!");
Assert.notNull(converter, "Converter must not be null");
return synchronizer.invoke(parentFunction, parentPipelineFunction, source -> {

View File

@@ -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<byte[]> 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<byte[]> 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<byte[]> 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);
}

View File

@@ -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<Long> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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);

View File

@@ -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<Boolean> 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> 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> 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);

View File

@@ -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<RedisServer> 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<RedisServer> 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());
}

View File

@@ -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<String> 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;

View File

@@ -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<byte[]> 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<byte[]> 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<Boolean> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]>(key, cursorId, options) {
@@ -226,7 +226,7 @@ class JedisSetCommands implements RedisSetCommands {
protected ScanIteration<byte[]> 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);

View File

@@ -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<byte[], byte[], byte[]> 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<RecordId> 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<ByteRecord> 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<StreamGroupInfo> 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<String> range = (Range<String>) options.getRange();
XPendingParams xPendingParams = StreamConverters.toXPendingParams(options);
@@ -241,9 +241,9 @@ class JedisStreamCommands implements RedisStreamCommands {
@Override
public List<ByteRecord> xRange(byte[] key, Range<String> 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<ByteRecord> xRead(StreamReadOptions readOptions, StreamOffset<byte[]>... 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<ByteRecord> xReadGroup(Consumer consumer, StreamReadOptions readOptions,
StreamOffset<byte[]>... 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<ByteRecord> xRevRange(byte[] key, Range<String> 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);
}

View File

@@ -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<byte[]> 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<byte[], byte[]> 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<byte[], byte[]> 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<Long> 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<Long> 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);
}

View File

@@ -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<Tuple> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<Number> 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<byte[]> 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<Tuple> 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<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<Number> 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<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<Number> 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<Number> 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<byte[]> 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<Tuple> 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<Tuple> 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<Double> 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<byte[]> 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<Number> 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<byte[]> 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<Tuple> 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<byte[]> 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<Tuple> 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<Tuple> 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<byte[]> 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<Tuple> 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<Tuple> 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<Tuple> 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<Tuple>(key, cursorId, options) {
@@ -572,7 +572,7 @@ class JedisZSetCommands implements RedisZSetCommands {
protected ScanIteration<Tuple> 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<byte[]> 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<byte[]> 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<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<Number> 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<byte[]> zRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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<byte[]> zRevRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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);

View File

@@ -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

View File

@@ -35,7 +35,7 @@ class LettuceByteBufferPubSubListenerWrapper implements RedisPubSubListener<Byte
LettuceByteBufferPubSubListenerWrapper(RedisPubSubListener<byte[], byte[]> delegate) {
Assert.notNull(delegate, "RedisPubSubListener must not be null!");
Assert.notNull(delegate, "RedisPubSubListener must not be null");
this.delegate = delegate;
}

View File

@@ -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;
}

View File

@@ -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<RedisClusterNode> 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<String>) 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<byte[], byte[]> getResourceForSpecificNode(RedisClusterNode node) {
Assert.notNull(node, "Node must not be null!");
Assert.notNull(node, "Node must not be null");
if (connection == null) {
synchronized (this) {

View File

@@ -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");
}
}

View File

@@ -78,7 +78,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands {
@Override
public Set<byte[]> keys(byte[] pattern) {
Assert.notNull(pattern, "Pattern must not be null!");
Assert.notNull(pattern, "Pattern must not be null");
Collection<List<byte[]>> keysPerNode = connection.getClusterCommandExecutor()
.executeCommandOnAllNodes((LettuceClusterCommandCallback<List<byte[]>>) 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<byte[]> 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<List<byte[]>>) client -> client.keys(pattern), node)
@@ -166,8 +166,8 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands {
*/
Cursor<byte[]> 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<ScanCursor<byte[]>>) 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);

View File

@@ -44,8 +44,8 @@ class LettuceClusterListCommands extends LettuceListCommands {
@Override
public List<byte[]> 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<byte[]> 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);

View File

@@ -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<NodeResult<Properties>> 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<NodeResult<Map<String, String>>> 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 <T> NodeResult<T> executeCommandOnSingleNode(LettuceClusterCommandCallback<T> command,
@@ -301,9 +301,9 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi
private static Long convertListOfStringToTime(List<byte[]> 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);

View File

@@ -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<byte[]> 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<byte[]> 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<byte[]> 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);

View File

@@ -34,7 +34,7 @@ class LettuceClusterStringCommands extends LettuceStringCommands {
@Override
public Boolean mSetNX(Map<byte[], byte[]> 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);

View File

@@ -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;
}

View File

@@ -231,7 +231,7 @@ public class LettuceConnection extends AbstractRedisConnection {
LettuceConnection(@Nullable StatefulConnection<byte[], byte[]> 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<byte[], byte[]> 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);
}
}
}

View File

@@ -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();
}

View File

@@ -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");
}
}

View File

@@ -41,7 +41,7 @@ class LettuceFutureUtils {
*/
static <T> CompletableFuture<T> failed(Throwable throwable) {
Assert.notNull(throwable, "Throwable must not be null!");
Assert.notNull(throwable, "Throwable must not be null");
CompletableFuture<T> future = new CompletableFuture<>();
future.completeExceptionally(throwable);
@@ -62,7 +62,7 @@ class LettuceFutureUtils {
@Nullable
static <T> T join(CompletionStage<T> 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();

View File

@@ -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<byte[], Point> 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<Object> values = new ArrayList<>();
for (Entry<byte[], Point> entry : memberCoordinateMap.entrySet()) {
@@ -82,8 +82,8 @@ class LettuceGeoCommands implements RedisGeoCommands {
@Override
public Long geoAdd(byte[] key, Iterable<GeoLocation<byte[]>> 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<Object> values = new ArrayList<>();
for (GeoLocation<byte[]> 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<Double, Distance> distanceConverter = LettuceConverters.distanceConverterForMetric(metric);
@@ -124,9 +124,9 @@ class LettuceGeoCommands implements RedisGeoCommands {
@Override
public List<String> 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<Point> 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<GeoLocation<byte[]>> 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<Set<byte[]>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters
.bytesSetToGeoResultsConverter();
@@ -161,9 +161,9 @@ class LettuceGeoCommands implements RedisGeoCommands {
@Override
public GeoResults<GeoLocation<byte[]>> 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<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters
@@ -183,9 +183,9 @@ class LettuceGeoCommands implements RedisGeoCommands {
@Override
public GeoResults<GeoLocation<byte[]>> 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<Set<byte[]>, GeoResults<GeoLocation<byte[]>>> converter = LettuceConverters
@@ -199,10 +199,10 @@ class LettuceGeoCommands implements RedisGeoCommands {
public GeoResults<GeoLocation<byte[]>> 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<GeoLocation<byte[]>> geoSearch(byte[] key, GeoReference<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> ref = LettuceConverters.toGeoRef(reference);
GeoSearch.GeoPredicate lettucePredicate = LettuceConverters.toGeoPredicate(predicate);

View File

@@ -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<byte[], byte[]> 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<byte[], byte[]> 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<byte[]> 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<Entry<byte[], byte[]>> 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<byte[]> 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<byte[]> 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<byte[], byte[]> 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<byte[]> 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<Entry<byte[], byte[]>> 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<Entry<byte[], byte[]>>(key, cursorId, options) {
@@ -224,7 +224,7 @@ class LettuceHashCommands implements RedisHashCommands {
protected ScanIteration<Entry<byte[], byte[]>> 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);
}

View File

@@ -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);
}

View File

@@ -75,7 +75,7 @@ class LettuceInvoker {
@Nullable
<R> R just(ConnectionFunction0<R> 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, T1> R just(ConnectionFunction1<T1, R> 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, T1, T2> R just(ConnectionFunction2<T1, T2, R> 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, T1, T2, T3> R just(ConnectionFunction3<T1, T2, T3, R> 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, T1, T2, T3, T4> R just(ConnectionFunction4<T1, T2, T3, T4, R> 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, T1, T2, T3, T4, T5> R just(ConnectionFunction5<T1, T2, T3, T4, T5, R> 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 {
*/
<R> SingleInvocationSpec<R> from(ConnectionFunction0<R> 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 {
*/
<R, T1> SingleInvocationSpec<R> from(ConnectionFunction1<T1, R> 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 {
*/
<R, T1, T2> SingleInvocationSpec<R> from(ConnectionFunction2<T1, T2, R> 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 {
*/
<R, T1, T2, T3> SingleInvocationSpec<R> from(ConnectionFunction3<T1, T2, T3, R> 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 {
<R, T1, T2, T3, T4> SingleInvocationSpec<R> from(ConnectionFunction4<T1, T2, T3, T4, R> 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 {
<R, T1, T2, T3, T4, T5> SingleInvocationSpec<R> from(ConnectionFunction5<T1, T2, T3, T4, T5, R> 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 {
*/
<R extends Collection<E>, E> ManyInvocationSpec<E> fromMany(ConnectionFunction0<R> 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 {
*/
<R extends Collection<E>, E, T1> ManyInvocationSpec<E> fromMany(ConnectionFunction1<T1, R> 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 {
<R extends Collection<E>, E, T1, T2> ManyInvocationSpec<E> fromMany(ConnectionFunction2<T1, T2, R> 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 {
<R extends Collection<E>, E, T1, T2, T3> ManyInvocationSpec<E> fromMany(ConnectionFunction3<T1, T2, T3, R> 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 {
<R extends Collection<E>, E, T1, T2, T3, T4> ManyInvocationSpec<E> fromMany(
ConnectionFunction4<T1, T2, T3, T4, R> 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 {
<R extends Collection<E>, E, T1, T2, T3, T4, T5> ManyInvocationSpec<E> fromMany(
ConnectionFunction5<T1, T2, T3, T4, T5, R> 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> T getOrElse(Converter<S, T> converter, Supplier<T> 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 <T> List<T> toList(Converter<S, T> 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 <T> Set<T> toSet(Converter<S, T> converter) {
Assert.notNull(converter, "Converter must not be null!");
Assert.notNull(converter, "Converter must not be null");
return synchronizer.invoke(parent, source -> {

View File

@@ -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<byte[]> 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<byte[]> 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<byte[]> 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);
}

View File

@@ -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<Long> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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);

View File

@@ -35,8 +35,8 @@ class LettuceMessageListener implements RedisPubSubListener<byte[], byte[]> {
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;

View File

@@ -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;

View File

@@ -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()));
}

Some files were not shown because too many files have changed in this diff Show More