List of usage examples for org.springframework.data.redis.connection RedisConnection zScore
@Nullable Double zScore(byte[] key, byte[] value);
From source file:com.mauersu.util.redis.DefaultZSetOperations.java
public Double score(K key, Object o) { final byte[] rawKey = rawKey(key); final byte[] rawValue = rawValue(o); return execute(new RedisCallback<Double>() { public Double doInRedis(RedisConnection connection) { connection.select(dbIndex);/*from w ww . j av a 2s .c om*/ return connection.zScore(rawKey, rawValue); } }, true); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Get the score of element with {@code value} from sorted set with key {@code key}. * <p>//from w ww.jav a2s. c o m * See http://redis.io/commands/zrem * * @param key key * @param value value * @return Double */ public static Double zScore(byte[] key, byte[] value) { return redisTemplate.execute(new RedisCallback<Double>() { @Override public Double doInRedis(RedisConnection redis) throws DataAccessException { return redis.zScore(key, value); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Get the score of element with {@code value} from sorted set with key {@code key}. * <p>//from w w w. j av a2 s. co m * See http://redis.io/commands/zrem * * @param key key * @param value value * @return Double */ public Double zScore(byte[] key, byte[] value) { return redisTemplate.execute(new RedisCallback<Double>() { @Override public Double doInRedis(RedisConnection redis) throws DataAccessException { return redis.zScore(key, value); } }); }