private Set<Tuple> getTupledSet() { checkIsInMulti(); List<String> membersWithScores = client.getMultiBulkReply(); Set<Tuple> set = new LinkedHashSet<Tuple>(); Iterator<String> iterator = membersWithScores.iterator(); while (iterator.hasNext()) { set.add(new Tuple(iterator.next(), Double.valueOf(iterator.next()))); } return set; }
public Map<String, String> hgetAll(String key) { checkIsInMulti(); client.hgetAll(key); List<String> flatHash = client.getMultiBulkReply(); Map<String, String> hash = new HashMap<String, String>(); Iterator<String> iterator = flatHash.iterator(); while (iterator.hasNext()) { hash.put(iterator.next(), iterator.next()); } return hash; }
public List<String> blpop(int timeout, String... keys) { checkIsInMulti(); List<String> args = new ArrayList<String>(); for (String arg : keys) { args.add(arg); } args.add(String.valueOf(timeout)); client.blpop(args.toArray(new String[args.size()])); client.setTimeoutInfinite(); List<String> multiBulkReply = client.getMultiBulkReply(); client.rollbackTimeout(); return multiBulkReply; }
public List<String> keys(String pattern) { checkIsInMulti(); client.keys(pattern); return client.getMultiBulkReply(); }
public List<String> configGet(String pattern) { client.configGet(pattern); return client.getMultiBulkReply(); }
public Set<String> zrangeByScore(String key, double min, double max, int offset, int count) { checkIsInMulti(); client.zrangeByScore(key, min, max, offset, count); return new LinkedHashSet<String>(client.getMultiBulkReply()); }
public List<String> sort(String key, SortingParams sortingParameters) { checkIsInMulti(); client.sort(key, sortingParameters); return client.getMultiBulkReply(); }
public List<String> sort(String key) { checkIsInMulti(); client.sort(key); return client.getMultiBulkReply(); }
public Set<String> zrevrange(String key, int start, int end) { checkIsInMulti(); client.zrevrange(key, start, end); List<String> members = client.getMultiBulkReply(); return new LinkedHashSet<String>(members); }
public Set<String> sdiff(String... keys) { checkIsInMulti(); client.sdiff(keys); List<String> members = client.getMultiBulkReply(); return new LinkedHashSet<String>(members); }
public Set<String> smembers(String key) { checkIsInMulti(); client.smembers(key); List<String> members = client.getMultiBulkReply(); return new LinkedHashSet<String>(members); }
public List<String> lrange(String key, int start, int end) { checkIsInMulti(); client.lrange(key, start, end); return client.getMultiBulkReply(); }
public List<String> hvals(String key) { checkIsInMulti(); client.hvals(key); return client.getMultiBulkReply(); }
public List<String> hmget(String key, String... fields) { checkIsInMulti(); client.hmget(key, fields); return client.getMultiBulkReply(); }
public List<String> mget(String... keys) { checkIsInMulti(); client.mget(keys); return client.getMultiBulkReply(); }