add variadic arguments support to lpush and rpush

This commit is contained in:
Shaofeng Niu
2012-02-14 17:42:06 +08:00
parent 72ca494362
commit f010bc0f32
10 changed files with 50 additions and 25 deletions

View File

@@ -865,7 +865,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
* @return Integer reply, specifically, the number of elements inside the
* list after the push operation.
*/
public Long rpush(final String key, final String string) {
public Long rpush(final String key, final String... string) {
checkIsInMulti();
client.rpush(key, string);
return client.getIntegerReply();
@@ -886,7 +886,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
* @return Integer reply, specifically, the number of elements inside the
* list after the push operation.
*/
public Long lpush(final String key, final String string) {
public Long lpush(final String key, final String... string) {
checkIsInMulti();
client.lpush(key, string);
return client.getIntegerReply();