diff --git a/src/main/java/org/springframework/data/redis/connection/HyperLogLogCommands.java b/src/main/java/org/springframework/data/redis/connection/HyperLogLogCommands.java
index 63cb2de6e..7869202f1 100644
--- a/src/main/java/org/springframework/data/redis/connection/HyperLogLogCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/HyperLogLogCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 the original author or authors.
+ * Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.data.redis.connection;
* {@literal HyperLogLog} specific commands supported by Redis.
*
* @author Christoph Strobl
+ * @author Mark Paluch
* @since 1.5
*/
public interface HyperLogLogCommands {
@@ -26,25 +27,28 @@ public interface HyperLogLogCommands {
/**
* Adds given {@literal values} to the HyperLogLog stored at given {@literal key}.
*
- * @param key
- * @param values
+ * @param key must not be {@literal null}.
+ * @param values must not be {@literal null}.
* @return
+ * @see Redis Documentation: PFADD
*/
Long pfAdd(byte[] key, byte[]... values);
/**
* Return the approximated cardinality of the structures observed by the HyperLogLog at {@literal key(s)}.
*
- * @param keys
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: PFCOUNT
*/
Long pfCount(byte[]... keys);
/**
* Merge N different HyperLogLogs at {@literal sourceKeys} into a single {@literal destinationKey}.
*
- * @param destinationKey
- * @param sourceKeys
+ * @param destinationKey must not be {@literal null}.
+ * @param sourceKeys must not be {@literal null}.
+ * @see Redis Documentation: PFMERGE
*/
void pfMerge(byte[] destinationKey, byte[]... sourceKeys);
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterCommands.java
index 8fd96356e..061068f5f 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisClusterCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 the original author or authors.
+ * Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ public interface RedisClusterCommands {
* Retrieve cluster node information such as {@literal id}, {@literal host}, {@literal port} and {@literal slots}.
*
* @return never {@literal null}.
+ * @see Redis Documentation: CLUSTER NODES
*/
Iterable clusterGetNodes();
@@ -44,6 +45,7 @@ public interface RedisClusterCommands {
*
* @param master must not be {@literal null}.
* @return never {@literal null}.
+ * @see Redis Documentation: CLUSTER SLAVES
*/
Collection clusterGetSlaves(RedisClusterNode master);
@@ -51,6 +53,7 @@ public interface RedisClusterCommands {
* Retrieve information about masters and their connected slaves.
*
* @return never {@literal null}.
+ * @see Redis Documentation: CLUSTER SLAVES
*/
Map> clusterGetMasterSlaveMap();
@@ -59,6 +62,7 @@ public interface RedisClusterCommands {
*
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: CLUSTER KEYSLOT
*/
Integer clusterGetSlotForKey(byte[] key);
@@ -82,6 +86,7 @@ public interface RedisClusterCommands {
* Get cluster information.
*
* @return
+ * @see Redis Documentation: CLUSTER INFO
*/
ClusterInfo clusterGetClusterInfo();
@@ -90,6 +95,7 @@ public interface RedisClusterCommands {
*
* @param node must not be {@literal null}.
* @param slots
+ * @see Redis Documentation: CLUSTER ADDSLOTS
*/
void clusterAddSlots(RedisClusterNode node, int... slots);
@@ -98,6 +104,7 @@ public interface RedisClusterCommands {
*
* @param node must not be {@literal null}.
* @param range must not be {@literal null}.
+ * @see Redis Documentation: CLUSTER ADDSLOTS
*/
void clusterAddSlots(RedisClusterNode node, SlotRange range);
@@ -106,6 +113,7 @@ public interface RedisClusterCommands {
*
* @param slot
* @return
+ * @see Redis Documentation: CLUSTER COUNTKEYSINSLOT
*/
Long clusterCountKeysInSlot(int slot);
@@ -114,6 +122,7 @@ public interface RedisClusterCommands {
*
* @param node must not be {@literal null}.
* @param slots
+ * @see Redis Documentation: CLUSTER DELSLOTS
*/
void clusterDeleteSlots(RedisClusterNode node, int... slots);
@@ -122,6 +131,7 @@ public interface RedisClusterCommands {
*
* @param node must not be {@literal null}.
* @param range must not be {@literal null}.
+ * @see Redis Documentation: CLUSTER DELSLOTS
*/
void clusterDeleteSlotsInRange(RedisClusterNode node, SlotRange range);
@@ -129,6 +139,7 @@ public interface RedisClusterCommands {
* Remove given {@literal node} from cluster.
*
* @param node must not be {@literal null}.
+ * @see Redis Documentation: CLUSTER FORGET
*/
void clusterForget(RedisClusterNode node);
@@ -137,6 +148,7 @@ public interface RedisClusterCommands {
*
* @param node must contain {@link RedisClusterNode#getHost() host} and {@link RedisClusterNode#getPort()} and must
* not be {@literal null}.
+ * @see Redis Documentation: CLUSTER MEET
*/
void clusterMeet(RedisClusterNode node);
@@ -144,6 +156,7 @@ public interface RedisClusterCommands {
* @param node must not be {@literal null}.
* @param slot
* @param mode must not be{@literal null}.
+ * @see Redis Documentation: CLUSTER SETSLOT
*/
void clusterSetSlot(RedisClusterNode node, int slot, AddSlots mode);
@@ -153,6 +166,7 @@ public interface RedisClusterCommands {
* @param slot
* @param count must not be {@literal null}.
* @return
+ * @see Redis Documentation: CLUSTER GETKEYSINSLOT
*/
List clusterGetKeysInSlot(int slot, Integer count);
@@ -161,6 +175,7 @@ public interface RedisClusterCommands {
*
* @param master must not be {@literal null}.
* @param slave must not be {@literal null}.
+ * @see Redis Documentation: CLUSTER REPLICATE
*/
void clusterReplicate(RedisClusterNode master, RedisClusterNode slave);
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
index e20f869c4..d96fd2632 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,34 +20,32 @@ package org.springframework.data.redis.connection;
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author Mark Paluch
*/
public interface RedisConnectionCommands {
/**
* Select the DB with given positive {@code dbIndex}.
- *
- * See http://redis.io/commands/select
- *
- * @param dbIndex
+ *
+ * @param dbIndex the database index.
+ * @see Redis Documentation: SELECT
*/
void select(int dbIndex);
/**
* Returns {@code message} via server roundtrip.
- *
- * See http://redis.io/commands/echo
- *
- * @param message
+ *
+ * @param message the message to echo.
* @return
+ * @see Redis Documentation: ECHO
*/
byte[] echo(byte[] message);
/**
* Test connection.
- *
- * See http://redis.io/commands/ping
- *
+ *
* @return Server response message - usually {@literal PONG}.
+ * @see Redis Documentation: PING
*/
String ping();
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java
index 6d7ee8582..d3afb8b1d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisGeoCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,9 @@
*/
package org.springframework.data.redis.connection;
+import lombok.Data;
+import lombok.RequiredArgsConstructor;
+
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -28,14 +31,12 @@ import org.springframework.data.geo.Metric;
import org.springframework.data.geo.Point;
import org.springframework.util.Assert;
-import lombok.Data;
-import lombok.RequiredArgsConstructor;
-
/**
* Geo-specific Redis commands.
*
* @author Ninad Divadkar
* @author Christoph Strobl
+ * @author Mark Paluch
* @since 1.8
*/
public interface RedisGeoCommands {
@@ -47,7 +48,7 @@ public interface RedisGeoCommands {
* @param point must not be {@literal null}.
* @param member must not be {@literal null}.
* @return Number of elements added.
- * @see http://redis.io/commands/geoadd
+ * @see Redis Documentation: GEOADD
*/
Long geoAdd(byte[] key, Point point, byte[] member);
@@ -57,7 +58,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param location must not be {@literal null}.
* @return Number of elements added.
- * @see http://redis.io/commands/geoadd
+ * @see Redis Documentation: GEOADD
*/
Long geoAdd(byte[] key, GeoLocation location);
@@ -67,7 +68,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param memberCoordinateMap must not be {@literal null}.
* @return Number of elements added.
- * @see http://redis.io/commands/geoadd
+ * @see Redis Documentation: GEOADD
*/
Long geoAdd(byte[] key, Map memberCoordinateMap);
@@ -77,7 +78,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param locations must not be {@literal null}.
* @return Number of elements added.
- * @see http://redis.io/commands/geoadd
+ * @see Redis Documentation: GEOADD
*/
Long geoAdd(byte[] key, Iterable> locations);
@@ -88,7 +89,7 @@ public interface RedisGeoCommands {
* @param member1 must not be {@literal null}.
* @param member2 must not be {@literal null}.
* @return can be {@literal null}.
- * @see http://redis.io/commands/geodist
+ * @see Redis Documentation: GEODIST
*/
Distance geoDist(byte[] key, byte[] member1, byte[] member2);
@@ -100,7 +101,7 @@ public interface RedisGeoCommands {
* @param member2 must not be {@literal null}.
* @param metric must not be {@literal null}.
* @return can be {@literal null}.
- * @see http://redis.io/commands/geodist
+ * @see Redis Documentation: GEODIST
*/
Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric);
@@ -110,7 +111,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param members must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/geohash
+ * @see Redis Documentation: GEOHASH
*/
List geoHash(byte[] key, byte[]... members);
@@ -120,7 +121,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param members must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/geopos
+ * @see Redis Documentation: GEOPOS
*/
List geoPos(byte[] key, byte[]... members);
@@ -130,7 +131,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param within must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/georadius
+ * @see Redis Documentation: GEORADIUS
*/
GeoResults> geoRadius(byte[] key, Circle within);
@@ -141,7 +142,7 @@ public interface RedisGeoCommands {
* @param within must not be {@literal null}.
* @param args must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/georadius
+ * @see Redis Documentation: GEORADIUS
*/
GeoResults> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args);
@@ -153,7 +154,7 @@ public interface RedisGeoCommands {
* @param member must not be {@literal null}.
* @param radius
* @return never {@literal null}.
- * @see http://redis.io/commands/georadiusbymember
+ * @see Redis Documentation: GEORADIUSBYMEMBER
*/
GeoResults> geoRadiusByMember(byte[] key, byte[] member, double radius);
@@ -165,7 +166,7 @@ public interface RedisGeoCommands {
* @param member must not be {@literal null}.
* @param radius must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/georadiusbymember
+ * @see Redis Documentation: GEORADIUSBYMEMBER
*/
GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius);
@@ -178,7 +179,7 @@ public interface RedisGeoCommands {
* @param radius must not be {@literal null}.
* @param args must not be {@literal null}.
* @return never {@literal null}.
- * @see http://redis.io/commands/georadiusbymember
+ * @see Redis Documentation: GEORADIUSBYMEMBER
*/
GeoResults> geoRadiusByMember(byte[] key, byte[] member, Distance radius,
GeoRadiusCommandArgs args);
@@ -189,6 +190,7 @@ public interface RedisGeoCommands {
* @param key must not be {@literal null}.
* @param members must not be {@literal null}.
* @return Number of elements removed.
+ * @see Redis Documentation: ZREM
*/
Long geoRemove(byte[] key, byte[]... members);
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
index 9d7b3e522..4e533f233 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,146 +27,147 @@ import org.springframework.data.redis.core.ScanOptions;
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author Mark Paluch
*/
public interface RedisHashCommands {
/**
* Set the {@code value} of a hash {@code field}.
*
- * @see http://redis.io/commands/hset
- * @param key
- * @param field
+ * @param key must not be {@literal null}.
+ * @param field must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: HSET
*/
Boolean hSet(byte[] key, byte[] field, byte[] value);
/**
* Set the {@code value} of a hash {@code field} only if {@code field} does not exist.
*
- * @see http://redis.io/commands/hsetnx
- * @param key
- * @param field
+ * @param key must not be {@literal null}.
+ * @param field must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: HSETNX
*/
Boolean hSetNX(byte[] key, byte[] field, byte[] value);
/**
* Get value for given {@code field} from hash at {@code key}.
*
- * @see http://redis.io/commands/hget
- * @param key
- * @param field
+ * @param key must not be {@literal null}.
+ * @param field must not be {@literal null}.
* @return
+ * @see Redis Documentation: HGET
*/
byte[] hGet(byte[] key, byte[] field);
/**
* Get values for given {@code fields} from hash at {@code key}.
*
- * @see http://redis.io/commands/hmget
- * @param key
- * @param fields
+ * @param key must not be {@literal null}.
+ * @param fields must not be {@literal null}.
* @return
+ * @see Redis Documentation: HMGET
*/
List hMGet(byte[] key, byte[]... fields);
/**
* Set multiple hash fields to multiple values using data provided in {@code hashes}
*
- * @see http://redis.io/commands/hmset
- * @param key
- * @param hashes
+ * @param key must not be {@literal null}.
+ * @param hashes must not be {@literal null}.
+ * @see Redis Documentation: HMSET
*/
void hMSet(byte[] key, Map hashes);
/**
* Increment {@code value} of a hash {@code field} by the given {@code delta}.
*
- * @see http://redis.io/commands/hincrby
- * @param key
- * @param field
+ * @param key must not be {@literal null}.
+ * @param field must not be {@literal null}.
* @param delta
* @return
+ * @see Redis Documentation: HINCRBY
*/
Long hIncrBy(byte[] key, byte[] field, long delta);
/**
* Increment {@code value} of a hash {@code field} by the given {@code delta}.
*
- * @see http://redis.io/commands/hincrbyfloat
- * @param key
+ * @param key must not be {@literal null}.
* @param field
* @param delta
* @return
+ * @see Redis Documentation: HINCRBYFLOAT
*/
Double hIncrBy(byte[] key, byte[] field, double delta);
/**
* Determine if given hash {@code field} exists.
*
- * @see http://redis.io/commands/hexits
- * @param key
- * @param field
+ * @param key must not be {@literal null}.
+ * @param field must not be {@literal null}.
* @return
+ * @see Redis Documentation: HEXISTS
*/
Boolean hExists(byte[] key, byte[] field);
/**
* Delete given hash {@code fields}.
- *
- * @see http://redis.io/commands/hdel
- * @param key
- * @param fields
+ *
+ * @param key must not be {@literal null}.
+ * @param fields must not be {@literal null}.
* @return
+ * @see Redis Documentation: HDEL
*/
Long hDel(byte[] key, byte[]... fields);
/**
* Get size of hash at {@code key}.
*
- * @see http://redis.io/commands/hlen
- * @param key
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: HLEN
*/
Long hLen(byte[] key);
/**
* Get key set (fields) of hash at {@code key}.
*
- * @see http://redis.io/commands/h?
- * @param key
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: HKEYS?
*/
Set hKeys(byte[] key);
/**
* Get entry set (values) of hash at {@code field}.
*
- * @see http://redis.io/commands/hvals
- * @param key
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: HVALS
*/
List hVals(byte[] key);
/**
* Get entire hash stored at {@code key}.
*
- * @see http://redis.io/commands/hgetall
- * @param key
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: HGETALL
*/
Map hGetAll(byte[] key);
/**
* Use a {@link Cursor} to iterate over entries in hash at {@code key}.
*
- * @since 1.4
- * @see http://redis.io/commands/scan
- * @param key
- * @param options
+ * @param key must not be {@literal null}.
+ * @param options must not be {@literal null}.
* @return
+ * @since 1.4
+ * @see Redis Documentation: HSCAN
*/
Cursor> hScan(byte[] key, ScanOptions options);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
index a3c70a708..1f372479d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,235 +33,213 @@ public interface RedisKeyCommands {
/**
* Determine if given {@code key} exists.
- *
- * See http://redis.io/commands/exists
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: EXISTS
*/
Boolean exists(byte[] key);
/**
* Delete given {@code keys}.
- *
- * See http://redis.io/commands/del
- *
- * @param keys
+ *
+ * @param keys must not be {@literal null}.
* @return The number of keys that were removed.
+ * @see Redis Documentation: DEL
*/
Long del(byte[]... keys);
/**
* Determine the type stored at {@code key}.
- *
- * See http://redis.io/commands/type
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: TYPE
*/
DataType type(byte[] key);
/**
* Find all keys matching the given {@code pattern}.
- *
- * See http://redis.io/commands/keys
- *
- * @param pattern
+ *
+ * @param pattern must not be {@literal null}.
* @return
+ * @see Redis Documentation: KEYS
*/
Set keys(byte[] pattern);
/**
* Use a {@link Cursor} to iterate over keys.
- *
- * See http://redis.io/commands/scan
- *
- * @param options
+ *
+ * @param options must not be {@literal null}.
* @return
* @since 1.4
+ * @see Redis Documentation: SCAN
*/
Cursor scan(ScanOptions options);
/**
* Return a random key from the keyspace.
- *
- * See http://redis.io/commands/rename
- *
- * @param oldName
- * @param newName
+ * Rename key {@code oldName} to {@code newName}.
+ *
+ * @param oldName must not be {@literal null}.
+ * @param newName must not be {@literal null}.
+ * @see Redis Documentation: RENAME
*/
void rename(byte[] oldName, byte[] newName);
/**
- * Rename key {@code oleName} to {@code newName} only if {@code newName} does not exist.
- *
- * See http://redis.io/commands/renamenx
- *
- * @param oldName
- * @param newName
+ * Rename key {@code oldName} to {@code newName} only if {@code newName} does not exist.
+ *
+ * @param oldName must not be {@literal null}.
+ * @param newName must not be {@literal null}.
* @return
+ * @see Redis Documentation: RENAMENX
*/
Boolean renameNX(byte[] oldName, byte[] newName);
/**
* Set time to live for given {@code key} in seconds.
- *
- * See http://redis.io/commands/expire
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param seconds
* @return
+ * @see Redis Documentation: EXPIRE
*/
Boolean expire(byte[] key, long seconds);
/**
* Set time to live for given {@code key} in milliseconds.
- *
- * See http://redis.io/commands/pexpire
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param millis
* @return
+ * @see Redis Documentation: PEXPIRE
*/
Boolean pExpire(byte[] key, long millis);
/**
* Set the expiration for given {@code key} as a {@literal UNIX} timestamp.
- *
- * See http://redis.io/commands/expireat
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param unixTime
* @return
+ * @see Redis Documentation: EXPIREAT
*/
Boolean expireAt(byte[] key, long unixTime);
/**
* Set the expiration for given {@code key} as a {@literal UNIX} timestamp in milliseconds.
- *
- * See http://redis.io/commands/pexpireat
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param unixTimeInMillis
* @return
+ * @see Redis Documentation: PEXPIREAT
*/
Boolean pExpireAt(byte[] key, long unixTimeInMillis);
/**
* Remove the expiration from given {@code key}.
- *
- * See http://redis.io/commands/persist
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: PERSIST
*/
Boolean persist(byte[] key);
/**
* Move given {@code key} to database with {@code index}.
- *
- * See http://redis.io/commands/move
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param dbIndex
* @return
+ * @see Redis Documentation: MOVE
*/
Boolean move(byte[] key, int dbIndex);
/**
* Get the time to live for {@code key} in seconds.
- *
- * See http://redis.io/commands/ttl
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: TTL
*/
Long ttl(byte[] key);
/**
* Get the time to live for {@code key} in and convert it to the given {@link TimeUnit}.
- *
- * See http://redis.io/commands/ttl
*
- * @param key
- * @param timeUnit
+ * @param key must not be {@literal null}.
+ * @param timeUnit must not be {@literal null}.
* @return
* @since 1.8
+ * @see Redis Documentation: TTL
*/
Long ttl(byte[] key, TimeUnit timeUnit);
/**
* Get the precise time to live for {@code key} in milliseconds.
- *
- * See http://redis.io/commands/pttl
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: PTTL
*/
Long pTtl(byte[] key);
/**
* Get the precise time to live for {@code key} in and convert it to the given {@link TimeUnit}.
- *
- * See http://redis.io/commands/pttl
*
- * @param key
- * @param timeUnit
+ * @param key must not be {@literal null}.
+ * @param timeUnit must not be {@literal null}.
* @return
* @since 1.8
+ * @see Redis Documentation: PTTL
*/
Long pTtl(byte[] key, TimeUnit timeUnit);
/**
* Sort the elements for {@code key}.
- *
- * See http://redis.io/commands/sort
- *
- * @param key
- * @param params
+ *
+ * @param key must not be {@literal null}.
+ * @param params must not be {@literal null}.
* @return
+ * @see Redis Documentation: SORT
*/
List sort(byte[] key, SortParameters params);
/**
* Sort the elements for {@code key} and store result in {@code storeKey}.
- *
- * See http://redis.io/commands/sort
- *
- * @param key
- * @param params
- * @param storeKey
- * @return
+ *
+ * @param key must not be {@literal null}.
+ * @param params must not be {@literal null}.
+ * @param storeKey must not be {@literal null}.
+ * @return number of values.
+ * @see Redis Documentation: SORT
*/
Long sort(byte[] key, SortParameters params, byte[] storeKey);
/**
* Retrieve serialized version of the value stored at {@code key}.
- *
- * See http://redis.io/commands/dump
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: DUMP
*/
byte[] dump(byte[] key);
/**
* Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(byte[])}.
- *
- * See http://redis.io/commands/restore
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param ttlInMillis
- * @param serializedValue
+ * @param serializedValue must not be {@literal null}.
+ * @see Redis Documentation: RESTORE
*/
void restore(byte[] key, long ttlInMillis, byte[] serializedValue);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
index 7a20c4c3a..0f4c6fe1c 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import java.util.List;
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author Mark Paluch
*/
public interface RedisListCommands {
@@ -34,194 +35,180 @@ public interface RedisListCommands {
/**
* Append {@code values} to {@code key}.
- *
- * See http://redis.io/commands/rpush
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param values
* @return
+ * @see Redis Documentation: RPUSH
*/
Long rPush(byte[] key, byte[]... values);
/**
* Prepend {@code values} to {@code key}.
- *
- * See http://redis.io/commands/lpush
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param values
* @return
+ * @see Redis Documentation: LPUSH
*/
Long lPush(byte[] key, byte[]... values);
/**
- * Append {@code} values to {@code key} only if the list exists.
- *
- * See http://redis.io/commands/rpushx
- *
- * @param key
+ * Append {@code values} to {@code key} only if the list exists.
+ *
+ * @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: RPUSHX
*/
Long rPushX(byte[] key, byte[] value);
/**
* Prepend {@code values} to {@code key} only if the list exists.
- *
- * See http://redis.io/commands/lpushx
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: LPUSHX
*/
Long lPushX(byte[] key, byte[] value);
/**
* Get the size of list stored at {@code key}.
- *
- * See http://redis.io/commands/llen
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: LLEN
*/
Long lLen(byte[] key);
/**
- * Get elements between {@code begin} and {@code end} from list at {@code key}.
- *
- * See http://redis.io/commands/lrange
- *
- * @param key
- * @param begin
+ * Get elements between {@code start} and {@code end} from list at {@code key}.
+ *
+ * @param key must not be {@literal null}.
+ * @param start
* @param end
* @return
+ * @see Redis Documentation: LRANGE
*/
- List lRange(byte[] key, long begin, long end);
+ List lRange(byte[] key, long start, long end);
/**
- * Trim list at {@code key} to elements between {@code begin} and {@code end}.
- *
- * See http://redis.io/commands/ltrim
- *
- * @param key
- * @param begin
+ * Trim list at {@code key} to elements between {@code start} and {@code end}.
+ *
+ * @param key must not be {@literal null}.
+ * @param start
* @param end
+ * @see Redis Documentation: LTRIM
*/
- void lTrim(byte[] key, long begin, long end);
+ void lTrim(byte[] key, long start, long end);
/**
* Get element at {@code index} form list at {@code key}.
- *
- * See http://redis.io/commands/lindex
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param index
* @return
+ * @see Redis Documentation: LINDEX
*/
byte[] lIndex(byte[] key, long index);
/**
* Insert {@code value} {@link Position#BEFORE} or {@link Position#AFTER} existing {@code pivot} for {@code key}.
- *
- * See http://redis.io/commands/linsert
- *
- * @param key
- * @param where
+ *
+ * @param key must not be {@literal null}.
+ * @param where must not be {@literal null}.
* @param pivot
* @param value
* @return
+ * @see Redis Documentation: LINSERT
*/
Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value);
/**
* Set the {@code value} list element at {@code index}.
- *
- * See http://redis.io/commands/lset
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param index
* @param value
+ * @see Redis Documentation: LSET
*/
void lSet(byte[] key, long index, byte[] value);
/**
* Removes the first {@code count} occurrences of {@code value} from the list stored at {@code key}.
- *
- * See http://redis.io/commands/lrem
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param count
* @param value
* @return
+ * @see Redis Documentation: LREM
*/
Long lRem(byte[] key, long count, byte[] value);
/**
* Removes and returns first element in list stored at {@code key}.
- *
- * See http://redis.io/commands/lpop
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: LPOP
*/
byte[] lPop(byte[] key);
/**
* Removes and returns last element in list stored at {@code key}.
- *
- * See http://redis.io/commands/rpop
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: RPOP
*/
byte[] rPop(byte[] key);
/**
- * Removes and returns first element from lists stored at {@code keys} (see: {@link #lPop(byte[])}).
+ * Removes and returns first element from lists stored at {@code keys}.
* Blocks connection until element available or {@code timeout} reached.
- *
- * See http://redis.io/commands/blpop
- *
+ *
* @param timeout
- * @param keys
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: BLPOP
+ * @see #lPop(byte[])
*/
List bLPop(int timeout, byte[]... keys);
/**
- * Removes and returns last element from lists stored at {@code keys} (see: {@link #rPop(byte[])}).
+ * Removes and returns last element from lists stored at {@code keys}.
* Blocks connection until element available or {@code timeout} reached.
- *
- * See http://redis.io/commands/brpop
- *
+ *
* @param timeout
- * @param keys
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: BRPOP
+ * @see #rPop(byte[])
*/
List bRPop(int timeout, byte[]... keys);
/**
* Remove the last element from list at {@code srcKey}, append it to {@code dstKey} and return its value.
- *
- * See http://redis.io/commands/rpoplpush
- *
- * @param srcKey
- * @param dstKey
+ *
+ * @param srcKey must not be {@literal null}.
+ * @param dstKey must not be {@literal null}.
* @return
+ * @see Redis Documentation: RPOPLPUSH
*/
byte[] rPopLPush(byte[] srcKey, byte[] dstKey);
/**
- * Remove the last element from list at {@code srcKey}, append it to {@code dstKey} and return its value (see
- * {@link #rPopLPush(byte[], byte[])}).
+ * Remove the last element from list at {@code srcKey}, append it to {@code dstKey} and return its value.
+ *
* Blocks connection until element available or {@code timeout} reached.
- *
- * See http://redis.io/commands/brpoplpush
- *
+ *
* @param timeout
- * @param srcKey
- * @param dstKey
+ * @param srcKey must not be {@literal null}.
+ * @param dstKey must not be {@literal null}.
* @return
+ * @see Redis Documentation: BRPOPLPUSH
+ * @see #rPopLPush(byte[], byte[])
*/
byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java
index 87da53380..a435c754b 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.data.redis.connection;
* PubSub-specific Redis commands.
*
* @author Costin Leau
+ * @author Mark Paluch
*/
public interface RedisPubSubCommands {
@@ -39,9 +40,10 @@ public interface RedisPubSubCommands {
/**
* Publishes the given message to the given channel.
*
- * @param channel the channel to publish to
+ * @param channel the channel to publish to, must not be {@literal null}.
* @param message message to publish
* @return the number of clients that received the message
+ * @see Redis Documentation: PUBLISH
*/
Long publish(byte[] channel, byte[] message);
@@ -51,8 +53,9 @@ public interface RedisPubSubCommands {
*
* Note that this operation is blocking and the current thread starts waiting for new messages immediately.
*
- * @param listener message listener
- * @param channels channel names
+ * @param listener message listener, must not be {@literal null}.
+ * @param channels channel names, must not be {@literal null}.
+ * @see Redis Documentation: SUBSCRIBE
*/
void subscribe(MessageListener listener, byte[]... channels);
@@ -63,8 +66,9 @@ public interface RedisPubSubCommands {
*
* Note that this operation is blocking and the current thread starts waiting for new messages immediately.
*
- * @param listener message listener
- * @param patterns channel name patterns
+ * @param listener message listener, must not be {@literal null}.
+ * @param patterns channel name patterns, must not be {@literal null}.
+ * @see Redis Documentation: PSUBSCRIBE
*/
void pSubscribe(MessageListener listener, byte[]... patterns);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
index 0f22e6217..48614c58a 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2014 the original author or authors.
+ * Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,81 +23,77 @@ import java.util.List;
* @author Costin Leau
* @author Christoph Strobl
* @author David Liu
+ * @author Mark Paluch
*/
public interface RedisScriptingCommands {
/**
* Flush lua script cache.
- *
- * See http://redis.io/commands/script-kill
+ *
+ * @see Redis Documentation: SCRIPT KILL
*/
void scriptKill();
/**
* Load lua script into scripts cache, without executing it.
- * Execute the script by calling {@link #evalSha(String, ReturnType, int, byte[])}.
- *
- * See http://redis.io/commands/script-load
- *
- * @param script
+ * Execute the script by calling {@link #evalSha(byte[], ReturnType, int, byte[]...)}.
+ *
+ * @param script must not be {@literal null}.
* @return
+ * @see Redis Documentation: SCRIPT LOAD
*/
String scriptLoad(byte[] script);
/**
* Check if given {@code scriptShas} exist in script cache.
- *
- * See http://redis.io/commands/script-exits
- *
+ *
* @param scriptShas
* @return one entry per given scriptSha in returned list.
+ * @see Redis Documentation: SCRIPT EXISTS
*/
List scriptExists(String... scriptShas);
/**
* Evaluate given {@code script}.
- *
- * See http://redis.io/commands/eval
- *
- * @param script
- * @param returnType
+ *
+ * @param script must not be {@literal null}.
+ * @param returnType must not be {@literal null}.
* @param numKeys
- * @param keysAndArgs
+ * @param keysAndArgs must not be {@literal null}.
* @return
+ * @see Redis Documentation: EVAL
*/
T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
/**
* Evaluate given {@code scriptSha}.
- *
- * See http://redis.io/commands/evalsha
- *
- * @param scriptSha
- * @param returnType
+ *
+ * @param scriptSha must not be {@literal null}.
+ * @param returnType must not be {@literal null}.
* @param numKeys
- * @param keysAndArgs
+ * @param keysAndArgs must not be {@literal null}.
* @return
+ * @see Redis Documentation: EVALSHA
*/
T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
/**
* Evaluate given {@code scriptSha}.
- *
- * See http://redis.io/commands/evalsha
- *
- * @param scriptSha
- * @param returnType
+ *
+ * @param scriptSha must not be {@literal null}.
+ * @param returnType must not be {@literal null}.
* @param numKeys
- * @param keysAndArgs
+ * @param keysAndArgs must not be {@literal null}.
* @return
* @since 1.5
+ * @see Redis Documentation: EVALSHA
*/
T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSentinelCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSentinelCommands.java
index 0fcc40f61..7e8009002 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisSentinelCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisSentinelCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 the original author or authors.
+ * Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,12 @@ package org.springframework.data.redis.connection;
import java.util.Collection;
/**
+ * Redis Sentinel-specific commands.
+ *
* @author Christoph Strobl
+ * @author Mark Paluch
* @since 1.4
+ * @see Redis Sentinel Documentation
*/
public interface RedisSentinelCommands {
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
index 6c35ef54d..fe9e3f269 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.data.redis.core.types.RedisClientInfo;
* @author Costin Leau
* @author Christoph Strobl
* @author Thomas Darimont
+ * @author Mark Paluch
*/
public interface RedisServerCommands {
@@ -42,133 +43,125 @@ public interface RedisServerCommands {
/**
* Start an {@literal Append Only File} rewrite process on server.
- *
- * See http://redis.io/commands/bgrewriteaof
*
* @deprecated As of 1.3, use {@link #bgReWriteAof}.
+ * @see Redis Documentation: BGREWRITEAOF
*/
@Deprecated
void bgWriteAof();
/**
* Start an {@literal Append Only File} rewrite process on server.
- *
- * See http://redis.io/commands/bgrewriteaof
- *
+ *
* @since 1.3
+ * @see Redis Documentation: BGREWRITEAOF
*/
void bgReWriteAof();
/**
* Start background saving of db on server.
- *
- * See http://redis.io/commands/bgsave
+ *
+ * @see Redis Documentation: BGSAVE
*/
void bgSave();
/**
* Get time of last {@link #bgSave()} operation in seconds.
- *
- * See http://redis.io/commands/lastsave
- *
+ *
* @return
+ * @see Redis Documentation: LASTSAVE
*/
Long lastSave();
/**
* Synchronous save current db snapshot on server.
- *
- * See http://redis.io/commands/save
+ *
+ * @see Redis Documentation: SAVE
*/
void save();
/**
* Get the total number of available keys in currently selected database.
- *
- * See http://redis.io/commands/dbsize
- *
+ *
* @return
+ * @see Redis Documentation: DBSIZE
*/
Long dbSize();
/**
* Delete all keys of the currently selected database.
- *
- * See http://redis.io/commands/flushdb
+ *
+ * @see Redis Documentation: FLUSHDB
*/
void flushDb();
/**
* Delete all all keys from all databases.
- *
- * See http://redis.io/commands/flushall
+ *
+ * @see Redis Documentation: FLUSHALL
*/
void flushAll();
/**
* Load {@literal default} server information like
*
- *
mempory
+ *
memory
*
cpu utilization
*
replication
*
*
- * See http://redis.io/commands/info
*
* @return
+ * @see Redis Documentation: INFO
*/
Properties info();
/**
* Load server information for given {@code selection}.
- *
- * See http://redis.io/commands/shutdown
- *
+ *
+ * @see Redis Documentation: SHUTDOWN
* @since 1.3
*/
void shutdown(ShutdownOption option);
/**
* Load configuration parameters for given {@code pattern} from server.
- *
- * See http://redis.io/commands/config-get
- *
+ *
* @param pattern
* @return
+ * @see Redis Documentation: CONFIG GET
*/
List getConfig(String pattern);
/**
* Set server configuration for {@code param} to {@code value}.
- *
- * See http://redis.io/commands/config-set
- *
+ *
* @param param
* @param value
+ * @see Redis Documentation: CONFIG SET
*/
void setConfig(String param, String value);
/**
* Reset statistic counters on server.
* Counters can be retrieved using {@link #info()}.
- *
- * See http://redis.io/commands/config-resetstat
+ *
+ * @see Redis Documentation: CONFIG RESETSTAT
*/
void resetConfigStats();
@@ -177,6 +170,7 @@ public interface RedisServerCommands {
*
* @return current server time in milliseconds.
* @since 1.1
+ * @see Redis Documentation: TIME
*/
Long time();
@@ -186,6 +180,7 @@ public interface RedisServerCommands {
* @param host of connection to close.
* @param port of connection to close
* @since 1.3
+ * @see Redis Documentation: CLIENT KILL
*/
void killClient(String host, int port);
@@ -194,14 +189,14 @@ public interface RedisServerCommands {
*
* @param name
* @since 1.3
+ * @see Redis Documentation: CLIENT SETNAME
*/
void setClientName(byte[] name);
/**
* Returns the name of the current connection.
- *
- * See http://redis.io/commands/client-getname
- *
+ *
+ * @see Redis Documentation: CLIENT GETNAME
* @return
* @since 1.3
*/
@@ -209,50 +204,55 @@ public interface RedisServerCommands {
/**
* Request information and statistics about connected clients.
- *
- * See http://redis.io/commands/client-list
- *
+ *
* @return {@link List} of {@link RedisClientInfo} objects.
* @since 1.3
+ * @see Redis Documentation: CLIENT LIST
*/
List getClientList();
/**
* Change redis replication setting to new master.
- *
- * See http://redis.io/commands/slaveof
- *
- * @param host
+ *
+ * @param host must not be {@literal null}.
* @param port
* @since 1.3
+ * @see Redis Documentation: SLAVEOF
*/
void slaveOf(String host, int port);
/**
* Change server into master.
- *
- * See http://redis.io/commands/slaveof
- *
+ *
* @since 1.3
+ * @see Redis Documentation: SLAVEOF
*/
void slaveOfNoOne();
/**
+ * Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is
+ * deleted from the original instance and is guaranteed to exist in the target instance.
+ *
* @param key must not be {@literal null}.
* @param target must not be {@literal null}.
* @param dbIndex
* @param option can be {@literal null}. Defaulted to {@link MigrateOption#COPY}.
* @since 1.7
+ * @see Redis Documentation: MIGRATE
*/
void migrate(byte[] key, RedisNode target, int dbIndex, MigrateOption option);
/**
+ * Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is
+ * deleted from the original instance and is guaranteed to exist in the target instance.
+ *
* @param key must not be {@literal null}.
* @param target must not be {@literal null}.
* @param dbIndex
* @param option can be {@literal null}. Defaulted to {@link MigrateOption#COPY}.
* @param timeout
* @since 1.7
+ * @see Redis Documentation: MIGRATE
*/
void migrate(byte[] key, RedisNode target, int dbIndex, MigrateOption option, long timeout);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
index 7768e4dd5..818ff5e27 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,177 +26,162 @@ import org.springframework.data.redis.core.ScanOptions;
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author Mark Paluch
*/
public interface RedisSetCommands {
/**
* Add given {@code values} to set at {@code key}.
- *
- * See http://redis.io/commands/sadd
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param values
* @return
+ * @see Redis Documentation: SADD
*/
Long sAdd(byte[] key, byte[]... values);
/**
* Remove given {@code values} from set at {@code key} and return the number of removed elements.
- *
- * See http://redis.io/commands/srem
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param values
* @return
+ * @see Redis Documentation: SREM
*/
Long sRem(byte[] key, byte[]... values);
/**
* Remove and return a random member from set at {@code key}.
- *
- * See http://redis.io/commands/spop
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: SPOP
*/
byte[] sPop(byte[] key);
/**
* Move {@code value} from {@code srcKey} to {@code destKey}
- *
- * See http://redis.io/commands/smove
- *
- * @param srcKey
- * @param destKey
+ *
+ * @param srcKey must not be {@literal null}.
+ * @param destKey must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: SMOVE
*/
Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value);
/**
* Get size of set at {@code key}.
- *
- * See http://redis.io/commands/scard
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: SCARD
*/
Long sCard(byte[] key);
/**
* Check if set at {@code key} contains {@code value}.
- *
- * See http://redis.io/commands/sismember
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: SISMEMBER
*/
Boolean sIsMember(byte[] key, byte[] value);
/**
* Returns the members intersecting all given sets at {@code keys}.
- *
- * See http://redis.io/commands/sinter
- *
- * @param keys
+ *
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SINTER
*/
Set sInter(byte[]... keys);
/**
* Intersect all given sets at {@code keys} and store result in {@code destKey}.
- *
- * See http://redis.io/commands/sinterstore
- *
- * @param destKey
- * @param keys
+ *
+ * @param destKey must not be {@literal null}.
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SINTERSTORE
*/
Long sInterStore(byte[] destKey, byte[]... keys);
/**
* Union all sets at given {@code keys}.
- *
- * See http://redis.io/commands/sunion
- *
- * @param keys
+ *
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SUNION
*/
Set sUnion(byte[]... keys);
/**
* Union all sets at given {@code keys} and store result in {@code destKey}.
- *
- * See http://redis.io/commands/sunionstore
- *
- * @param destKey
- * @param keys
+ *
+ * @param destKey must not be {@literal null}.
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SUNIONSTORE
*/
Long sUnionStore(byte[] destKey, byte[]... keys);
/**
* Diff all sets for given {@code keys}.
- *
- * See http://redis.io/commands/sdiff
- *
- * @param keys
+ *
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SDIFF
*/
Set sDiff(byte[]... keys);
/**
- * Diff all sets for given {@code keys} and store result in {@code destKey}
- *
- * See http://redis.io/commands/sdiffstore
- *
- * @param destKey
- * @param keys
+ * Diff all sets for given {@code keys} and store result in {@code destKey}.
+ *
+ * @param destKey must not be {@literal null}.
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: SDIFFSTORE
*/
Long sDiffStore(byte[] destKey, byte[]... keys);
/**
* Get all elements of set at {@code key}.
- *
- * See http://redis.io/commands/smembers
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: SMEMBERS
*/
Set sMembers(byte[] key);
/**
* Get random element from set at {@code key}.
- *
- * See http://redis.io/commands/srandmember
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: SRANDMEMBER
*/
byte[] sRandMember(byte[] key);
/**
* Get {@code count} random elements from set at {@code key}.
- *
- * See http://redis.io/commands/srandmember
- *
- * @param key
+ *
+ * @param key must not be {@literal null}.
* @param count
* @return
+ * @see Redis Documentation: SRANDMEMBER
*/
List sRandMember(byte[] key, long count);
/**
* Use a {@link Cursor} to iterate over elements in set at {@code key}.
- *
- * See http://redis.io/commands/scan
- *
- * @since 1.4
- * @param key
- * @param options
+ *
+ * @param key must not be {@literal null}.
+ * @param options must not be {@literal null}.
* @return
+ * @since 1.4
+ * @see Redis Documentation: SCAN
*/
Cursor sScan(byte[] key, ScanOptions options);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
index b782c7966..3e7bda6a6 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,264 +35,240 @@ public interface RedisStringCommands {
/**
* Get the value of {@code key}.
- *
- * See http://redis.io/commands/get
- *
+ *
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: GET
*/
byte[] get(byte[] key);
/**
- * Set value of {@code key} and return its old value.
- *
- * See http://redis.io/commands/getset
- *
+ * Set {@code value} of {@code key} and return its old value.
+ *
* @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: GETSET
*/
byte[] getSet(byte[] key, byte[] value);
/**
- * Get the values of all given {@code keys}.
- *
- * See http://redis.io/commands/mget
- *
- * @param keys
+ * Get multiple {@code keys}. Values are returned in the order of the requested keys.
+ *
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: MGET
*/
List mGet(byte[]... keys);
/**
* Set {@code value} for {@code key}.
- *
- * See http://redis.io/commands/set
- *
+ *
* @param key must not be {@literal null}.
* @param value must not be {@literal null}.
+ * @see Redis Documentation: SET
*/
void set(byte[] key, byte[] value);
/**
* Set {@code value} for {@code key} applying timeouts from {@code expiration} if set and inserting/updating values
* depending on {@code option}.
- *
- * See http://redis.io/commands/set
*
* @param key must not be {@literal null}.
* @param value must not be {@literal null}.
* @param expiration can be {@literal null}. Defaulted to {@link Expiration#persistent()}.
* @param option can be {@literal null}. Defaulted to {@link SetOption#UPSERT}.
* @since 1.7
+ * @see Redis Documentation: SET
*/
void set(byte[] key, byte[] value, Expiration expiration, SetOption option);
/**
* Set {@code value} for {@code key}, only if {@code key} does not exist.
- *
- * See http://redis.io/commands/setnx
- *
+ *
* @param key must not be {@literal null}.
* @param value must not be {@literal null}.
* @return
+ * @see Redis Documentation: SETNX
*/
Boolean setNX(byte[] key, byte[] value);
/**
* Set the {@code value} and expiration in {@code seconds} for {@code key}.
- *
- * See http://redis.io/commands/setex
- *
+ *
* @param key must not be {@literal null}.
* @param seconds
* @param value must not be {@literal null}.
+ * @see Redis Documentation: SETEX
*/
void setEx(byte[] key, long seconds, byte[] value);
/**
* Set the {@code value} and expiration in {@code milliseconds} for {@code key}.
- *
- * See http://redis.io/commands/psetex
- *
+ *
* @param key must not be {@literal null}.
* @param milliseconds
* @param value must not be {@literal null}.
* @since 1.3
+ * @see Redis Documentation: PSETEX
*/
void pSetEx(byte[] key, long milliseconds, byte[] value);
/**
* Set multiple keys to multiple values using key-value pairs provided in {@code tuple}.
- *
- * See http://redis.io/commands/mset
- *
- * @param tuple
+ *
+ * @param tuple must not be {@literal null}.
+ * @see Redis Documentation: MSET
*/
void mSet(Map tuple);
/**
* Set multiple keys to multiple values using key-value pairs provided in {@code tuple} only if the provided key does
* not exist.
- *
- * See http://redis.io/commands/msetnx
- *
- * @param tuple
+ *
+ * @param tuple must not be {@literal null}.
+ * @see Redis Documentation: MSETNX
*/
Boolean mSetNX(Map tuple);
/**
- * Increment value of {@code key} by 1.
- *
- * See http://redis.io/commands/incr
- *
+ * Increment an integer value stored as string value of {@code key} by 1.
+ *
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: INCR
*/
Long incr(byte[] key);
/**
- * Increment value of {@code key} by {@code value}.
- *
- * See http://redis.io/commands/incrby
- *
+ * Increment an integer value stored of {@code key} by {@code delta}.
+ *
* @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: INCRBY
*/
Long incrBy(byte[] key, long value);
/**
- * Increment value of {@code key} by {@code value}.
- *
- * See http://redis.io/commands/incrbyfloat
- *
+ * Increment a floating point number value of {@code key} by {@code delta}.
+ *
* @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: INCRBYFLOAT
*/
Double incrBy(byte[] key, double value);
/**
- * Decrement value of {@code key} by 1.
- *
- * See http://redis.io/commands/decr
- *
+ * Decrement an integer value stored as string value of {@code key} by 1.
+ *
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: DECR
*/
Long decr(byte[] key);
/**
- * Increment value of {@code key} by {@code value}.
- *
- * See http://redis.io/commands/decrby
- *
+ * Decrement an integer value stored as string value of {@code key} by {@code value}.
+ *
* @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: DECRBY
*/
Long decrBy(byte[] key, long value);
/**
* Append a {@code value} to {@code key}.
- *
- * See http://redis.io/commands/append
- *
+ *
* @param key must not be {@literal null}.
* @param value
* @return
+ * @see Redis Documentation: APPEND
*/
Long append(byte[] key, byte[] value);
/**
* Get a substring of value of {@code key} between {@code begin} and {@code end}.
- *
- * See http://redis.io/commands/getrange
- *
+ *
* @param key must not be {@literal null}.
* @param begin
* @param end
* @return
+ * @see Redis Documentation: GETRANGE
*/
byte[] getRange(byte[] key, long begin, long end);
/**
* Overwrite parts of {@code key} starting at the specified {@code offset} with given {@code value}.
- *
- * See http://redis.io/commands/setrange
- *
+ *
* @param key must not be {@literal null}.
* @param value
* @param offset
+ * @see Redis Documentation: SETRANGE
*/
void setRange(byte[] key, byte[] value, long offset);
/**
* Get the bit value at {@code offset} of value at {@code key}.
- *
- * See http://redis.io/commands/getbit
- *
+ *
* @param key must not be {@literal null}.
* @param offset
* @return
+ * @see Redis Documentation: GETBIT
*/
Boolean getBit(byte[] key, long offset);
/**
* Sets the bit at {@code offset} in value stored at {@code key}.
- *
- * See http://redis.io/commands/setbit
- *
+ *
* @param key must not be {@literal null}.
* @param offset
* @param value
* @return the original bit value stored at {@code offset}.
+ * @see Redis Documentation: SETBIT
*/
Boolean setBit(byte[] key, long offset, boolean value);
/**
* Count the number of set bits (population counting) in value stored at {@code key}.
- *
- * See http://redis.io/commands/bitcount
- *
+ *
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: BITCOUNT
*/
Long bitCount(byte[] key);
/**
* Count the number of set bits (population counting) of value stored at {@code key} between {@code begin} and
* {@code end}.
- *
- * See http://redis.io/commands/bitcount
- *
+ *
* @param key must not be {@literal null}.
* @param begin
* @param end
* @return
+ * @see Redis Documentation: BITCOUNT
*/
Long bitCount(byte[] key, long begin, long end);
/**
* Perform bitwise operations between strings.
- *
- * See http://redis.io/commands/bitop
- *
- * @param op
- * @param destination
- * @param keys
+ *
+ * @param op must not be {@literal null}.
+ * @param destination must not be {@literal null}.
+ * @param keys must not be {@literal null}.
* @return
+ * @see Redis Documentation: BITOP
*/
Long bitOp(BitOperation op, byte[] destination, byte[]... keys);
/**
* Get the length of the value stored at {@code key}.
- *
- * See http://redis.io/commands/strlen
- *
+ *
* @param key must not be {@literal null}.
* @return
+ * @see Redis Documentation: STRLEN
*/
Long strLen(byte[] key);
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
index 2426d5284..8725f9e3a 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2014 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import java.util.List;
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author Mark Paluch
*/
public interface RedisTxCommands {
@@ -29,40 +30,39 @@ public interface RedisTxCommands {
* Mark the start of a transaction block.
* Commands will be queued and can then be executed by calling {@link #exec()} or rolled back using {@link #discard()}
*
- * See http://redis.io/commands/multi
+ *
+ * @see Redis Documentation: MULTI
*/
void multi();
/**
* Executes all queued commands in a transaction started with {@link #multi()}.
- * If used along with {@link #watch(byte[])} the operation will fail if any of watched keys has been modified.
- *
- * See http://redis.io/commands/exec
- *
+ * If used along with {@link #watch(byte[]...)} the operation will fail if any of watched keys has been modified.
+ *
* @return List of replies for each executed command.
+ * @see Redis Documentation: EXEC
*/
List