list command receive now long parameters to be consistent with return type
This commit is contained in:
@@ -255,23 +255,23 @@ public class BinaryClient extends Connection {
|
|||||||
sendCommand(LLEN, key);
|
sendCommand(LLEN, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lrange(final byte[] key, final int start, final int end) {
|
public void lrange(final byte[] key, final long start, final long end) {
|
||||||
sendCommand(LRANGE, key, toByteArray(start), toByteArray(end));
|
sendCommand(LRANGE, key, toByteArray(start), toByteArray(end));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ltrim(final byte[] key, final int start, final int end) {
|
public void ltrim(final byte[] key, final long start, final long end) {
|
||||||
sendCommand(LTRIM, key, toByteArray(start), toByteArray(end));
|
sendCommand(LTRIM, key, toByteArray(start), toByteArray(end));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lindex(final byte[] key, final int index) {
|
public void lindex(final byte[] key, final long index) {
|
||||||
sendCommand(LINDEX, key, toByteArray(index));
|
sendCommand(LINDEX, key, toByteArray(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lset(final byte[] key, final int index, final byte[] value) {
|
public void lset(final byte[] key, final long index, final byte[] value) {
|
||||||
sendCommand(LSET, key, toByteArray(index), value);
|
sendCommand(LSET, key, toByteArray(index), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lrem(final byte[] key, int count, final byte[] value) {
|
public void lrem(final byte[] key, long count, final byte[] value) {
|
||||||
sendCommand(LREM, key, toByteArray(count), value);
|
sendCommand(LREM, key, toByteArray(count), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,22 +207,22 @@ public class BinaryTransaction extends Queable {
|
|||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<List<String>> lrange(byte[] key, int start, int end) {
|
public Response<List<String>> lrange(byte[] key, long start, int end) {
|
||||||
client.lrange(key, start, end);
|
client.lrange(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING_LIST);
|
return getResponse(BuilderFactory.STRING_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<Long> lrem(byte[] key, int count, byte[] value) {
|
public Response<Long> lrem(byte[] key, long count, byte[] value) {
|
||||||
client.lrem(key, count, value);
|
client.lrem(key, count, value);
|
||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> lset(byte[] key, int index, byte[] value) {
|
public Response<String> lset(byte[] key, long index, byte[] value) {
|
||||||
client.lset(key, index, value);
|
client.lset(key, index, value);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> ltrim(byte[] key, int start, int end) {
|
public Response<String> ltrim(byte[] key, long start, long end) {
|
||||||
client.ltrim(key, start, end);
|
client.ltrim(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,23 +201,23 @@ public class Client extends BinaryClient implements Commands {
|
|||||||
llen(SafeEncoder.encode(key));
|
llen(SafeEncoder.encode(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lrange(final String key, final int start, final int end) {
|
public void lrange(final String key, final long start, final long end) {
|
||||||
lrange(SafeEncoder.encode(key), start, end);
|
lrange(SafeEncoder.encode(key), start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ltrim(final String key, final int start, final int end) {
|
public void ltrim(final String key, final long start, final long end) {
|
||||||
ltrim(SafeEncoder.encode(key), start, end);
|
ltrim(SafeEncoder.encode(key), start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lindex(final String key, final int index) {
|
public void lindex(final String key, final long index) {
|
||||||
lindex(SafeEncoder.encode(key), index);
|
lindex(SafeEncoder.encode(key), index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lset(final String key, final int index, final String value) {
|
public void lset(final String key, final long index, final String value) {
|
||||||
lset(SafeEncoder.encode(key), index, SafeEncoder.encode(value));
|
lset(SafeEncoder.encode(key), index, SafeEncoder.encode(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lrem(final String key, int count, final String value) {
|
public void lrem(final String key, long count, final String value) {
|
||||||
lrem(SafeEncoder.encode(key), count, SafeEncoder.encode(value));
|
lrem(SafeEncoder.encode(key), count, SafeEncoder.encode(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,23 +436,23 @@ public class Client extends BinaryClient implements Commands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void zrevrangeByScore(final String key, final double max,
|
public void zrevrangeByScore(final String key, final double max,
|
||||||
final double min) {
|
final double min) {
|
||||||
zrevrangeByScore(SafeEncoder.encode(key), max, min);
|
zrevrangeByScore(SafeEncoder.encode(key), max, min);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void zrevrangeByScore(final String key, final String max,
|
public void zrevrangeByScore(final String key, final String max,
|
||||||
final String min) {
|
final String min) {
|
||||||
zrevrangeByScore(SafeEncoder.encode(key), SafeEncoder.encode(max),
|
zrevrangeByScore(SafeEncoder.encode(key), SafeEncoder.encode(max),
|
||||||
SafeEncoder.encode(min));
|
SafeEncoder.encode(min));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void zrevrangeByScore(final String key, final double max,
|
public void zrevrangeByScore(final String key, final double max,
|
||||||
final double min, final int offset, int count) {
|
final double min, final int offset, int count) {
|
||||||
zrevrangeByScore(SafeEncoder.encode(key), max, min, offset, count);
|
zrevrangeByScore(SafeEncoder.encode(key), max, min, offset, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void zrevrangeByScoreWithScores(final String key, final double max,
|
public void zrevrangeByScoreWithScores(final String key, final double max,
|
||||||
final double min) {
|
final double min) {
|
||||||
zrevrangeByScoreWithScores(SafeEncoder.encode(key), max, min);
|
zrevrangeByScoreWithScores(SafeEncoder.encode(key), max, min);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package redis.clients.jedis;
|
package redis.clients.jedis;
|
||||||
|
|
||||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||||
|
|
||||||
public interface Commands {
|
public interface Commands {
|
||||||
|
|
||||||
public void set(final String key, final String value);
|
public void set(final String key, final String value);
|
||||||
@@ -92,15 +92,15 @@ public interface Commands {
|
|||||||
|
|
||||||
public void llen(final String key);
|
public void llen(final String key);
|
||||||
|
|
||||||
public void lrange(final String key, final int start, final int end);
|
public void lrange(final String key, final long start, final long end);
|
||||||
|
|
||||||
public void ltrim(final String key, final int start, final int end);
|
public void ltrim(final String key, final long start, final long end);
|
||||||
|
|
||||||
public void lindex(final String key, final int index);
|
public void lindex(final String key, final long index);
|
||||||
|
|
||||||
public void lset(final String key, final int index, final String value);
|
public void lset(final String key, final long index, final String value);
|
||||||
|
|
||||||
public void lrem(final String key, int count, final String value);
|
public void lrem(final String key, final long count, final String value);
|
||||||
|
|
||||||
public void lpop(final String key);
|
public void lpop(final String key);
|
||||||
|
|
||||||
@@ -253,10 +253,10 @@ public interface Commands {
|
|||||||
public void configGet(final String pattern);
|
public void configGet(final String pattern);
|
||||||
|
|
||||||
public void configResetStat();
|
public void configResetStat();
|
||||||
|
|
||||||
public void multi();
|
public void multi();
|
||||||
|
|
||||||
public void exec();
|
public void exec();
|
||||||
|
|
||||||
public void discard();
|
public void discard();
|
||||||
}
|
}
|
||||||
@@ -958,7 +958,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|||||||
* @return Multi bulk reply, specifically a list of elements in the
|
* @return Multi bulk reply, specifically a list of elements in the
|
||||||
* specified range.
|
* specified range.
|
||||||
*/
|
*/
|
||||||
public List<String> lrange(final String key, final int start, final int end) {
|
public List<String> lrange(final String key, final long start, final long end) {
|
||||||
checkIsInMulti();
|
checkIsInMulti();
|
||||||
client.lrange(key, start, end);
|
client.lrange(key, start, end);
|
||||||
return client.getMultiBulkReply();
|
return client.getMultiBulkReply();
|
||||||
@@ -998,7 +998,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|||||||
* @param end
|
* @param end
|
||||||
* @return Status code reply
|
* @return Status code reply
|
||||||
*/
|
*/
|
||||||
public String ltrim(final String key, final int start, final int end) {
|
public String ltrim(final String key, final long start, final long end) {
|
||||||
checkIsInMulti();
|
checkIsInMulti();
|
||||||
client.ltrim(key, start, end);
|
client.ltrim(key, start, end);
|
||||||
return client.getStatusCodeReply();
|
return client.getStatusCodeReply();
|
||||||
@@ -1022,7 +1022,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|||||||
* @param index
|
* @param index
|
||||||
* @return Bulk reply, specifically the requested element
|
* @return Bulk reply, specifically the requested element
|
||||||
*/
|
*/
|
||||||
public String lindex(final String key, final int index) {
|
public String lindex(final String key, final long index) {
|
||||||
checkIsInMulti();
|
checkIsInMulti();
|
||||||
client.lindex(key, index);
|
client.lindex(key, index);
|
||||||
return client.getBulkReply();
|
return client.getBulkReply();
|
||||||
@@ -1049,7 +1049,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|||||||
* @param value
|
* @param value
|
||||||
* @return Status code reply
|
* @return Status code reply
|
||||||
*/
|
*/
|
||||||
public String lset(final String key, final int index, final String value) {
|
public String lset(final String key, final long index, final String value) {
|
||||||
checkIsInMulti();
|
checkIsInMulti();
|
||||||
client.lset(key, index, value);
|
client.lset(key, index, value);
|
||||||
return client.getStatusCodeReply();
|
return client.getStatusCodeReply();
|
||||||
@@ -1074,7 +1074,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|||||||
* @return Integer Reply, specifically: The number of removed elements if
|
* @return Integer Reply, specifically: The number of removed elements if
|
||||||
* the operation succeeded
|
* the operation succeeded
|
||||||
*/
|
*/
|
||||||
public Long lrem(final String key, final int count, final String value) {
|
public Long lrem(final String key, final long count, final String value) {
|
||||||
checkIsInMulti();
|
checkIsInMulti();
|
||||||
client.lrem(key, count, value);
|
client.lrem(key, count, value);
|
||||||
return client.getIntegerReply();
|
return client.getIntegerReply();
|
||||||
|
|||||||
@@ -79,15 +79,15 @@ public interface JedisCommands {
|
|||||||
|
|
||||||
Long llen(String key);
|
Long llen(String key);
|
||||||
|
|
||||||
List<String> lrange(String key, int start, int end);
|
List<String> lrange(String key, long start, long end);
|
||||||
|
|
||||||
String ltrim(String key, int start, int end);
|
String ltrim(String key, long start, long end);
|
||||||
|
|
||||||
String lindex(String key, int index);
|
String lindex(String key, long index);
|
||||||
|
|
||||||
String lset(String key, int index, String value);
|
String lset(String key, long index, String value);
|
||||||
|
|
||||||
Long lrem(String key, int count, String value);
|
Long lrem(String key, long count, String value);
|
||||||
|
|
||||||
String lpop(String key);
|
String lpop(String key);
|
||||||
|
|
||||||
@@ -136,18 +136,22 @@ public interface JedisCommands {
|
|||||||
Long zcount(String key, double min, double max);
|
Long zcount(String key, double min, double max);
|
||||||
|
|
||||||
Set<String> zrangeByScore(String key, double min, double max);
|
Set<String> zrangeByScore(String key, double min, double max);
|
||||||
|
|
||||||
Set<String> zrevrangeByScore(String key, double max, double min);
|
Set<String> zrevrangeByScore(String key, double max, double min);
|
||||||
|
|
||||||
Set<String> zrangeByScore(String key, double min, double max, int offset,
|
Set<String> zrangeByScore(String key, double min, double max, int offset,
|
||||||
int count);
|
int count);
|
||||||
Set<String> zrevrangeByScore(String key, double max, double min, int offset,
|
|
||||||
int count);
|
Set<String> zrevrangeByScore(String key, double max, double min,
|
||||||
|
int offset, int count);
|
||||||
|
|
||||||
Set<Tuple> zrangeByScoreWithScores(String key, double min, double max);
|
Set<Tuple> zrangeByScoreWithScores(String key, double min, double max);
|
||||||
|
|
||||||
Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min);
|
Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min);
|
||||||
|
|
||||||
Set<Tuple> zrangeByScoreWithScores(String key, double min, double max,
|
Set<Tuple> zrangeByScoreWithScores(String key, double min, double max,
|
||||||
int offset, int count);
|
int offset, int count);
|
||||||
|
|
||||||
Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min,
|
Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min,
|
||||||
int offset, int count);
|
int offset, int count);
|
||||||
|
|
||||||
|
|||||||
@@ -366,42 +366,42 @@ public class Pipeline extends Queable {
|
|||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<List<String>> lrange(String key, int start, int end) {
|
public Response<List<String>> lrange(String key, long start, long end) {
|
||||||
client.lrange(key, start, end);
|
client.lrange(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING_LIST);
|
return getResponse(BuilderFactory.STRING_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<List<String>> lrange(byte[] key, int start, int end) {
|
public Response<List<String>> lrange(byte[] key, long start, long end) {
|
||||||
client.lrange(key, start, end);
|
client.lrange(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING_LIST);
|
return getResponse(BuilderFactory.STRING_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<Long> lrem(String key, int count, String value) {
|
public Response<Long> lrem(String key, long count, String value) {
|
||||||
client.lrem(key, count, value);
|
client.lrem(key, count, value);
|
||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<Long> lrem(byte[] key, int count, byte[] value) {
|
public Response<Long> lrem(byte[] key, long count, byte[] value) {
|
||||||
client.lrem(key, count, value);
|
client.lrem(key, count, value);
|
||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> lset(String key, int index, String value) {
|
public Response<String> lset(String key, long index, String value) {
|
||||||
client.lset(key, index, value);
|
client.lset(key, index, value);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> lset(byte[] key, int index, byte[] value) {
|
public Response<String> lset(byte[] key, long index, byte[] value) {
|
||||||
client.lset(key, index, value);
|
client.lset(key, index, value);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> ltrim(String key, int start, int end) {
|
public Response<String> ltrim(String key, long start, long end) {
|
||||||
client.ltrim(key, start, end);
|
client.ltrim(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> ltrim(byte[] key, int start, int end) {
|
public Response<String> ltrim(byte[] key, long start, long end) {
|
||||||
client.ltrim(key, start, end);
|
client.ltrim(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,27 +214,27 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
|||||||
return j.llen(key);
|
return j.llen(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> lrange(String key, int start, int end) {
|
public List<String> lrange(String key, long start, long end) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.lrange(key, start, end);
|
return j.lrange(key, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String ltrim(String key, int start, int end) {
|
public String ltrim(String key, long start, long end) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.ltrim(key, start, end);
|
return j.ltrim(key, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String lindex(String key, int index) {
|
public String lindex(String key, long index) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.lindex(key, index);
|
return j.lindex(key, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String lset(String key, int index, String value) {
|
public String lset(String key, long index, String value) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.lset(key, index, value);
|
return j.lset(key, index, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long lrem(String key, int count, String value) {
|
public Long lrem(String key, long count, String value) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.lrem(key, count, value);
|
return j.lrem(key, count, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,22 +191,22 @@ public class Transaction extends BinaryTransaction {
|
|||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<List<String>> lrange(String key, int start, int end) {
|
public Response<List<String>> lrange(String key, long start, long end) {
|
||||||
client.lrange(key, start, end);
|
client.lrange(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING_LIST);
|
return getResponse(BuilderFactory.STRING_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<Long> lrem(String key, int count, String value) {
|
public Response<Long> lrem(String key, long count, String value) {
|
||||||
client.lrem(key, count, value);
|
client.lrem(key, count, value);
|
||||||
return getResponse(BuilderFactory.LONG);
|
return getResponse(BuilderFactory.LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> lset(String key, int index, String value) {
|
public Response<String> lset(String key, long index, String value) {
|
||||||
client.lset(key, index, value);
|
client.lset(key, index, value);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response<String> ltrim(String key, int start, int end) {
|
public Response<String> ltrim(String key, long start, long end) {
|
||||||
client.ltrim(key, start, end);
|
client.ltrim(key, start, end);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user