Example usage for org.springframework.data.redis.connection RedisConnection type

List of usage examples for org.springframework.data.redis.connection RedisConnection type

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection type.

Prototype

@Nullable
DataType type(byte[] key);

Source Link

Document

Determine the type stored at key .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Determine the type stored at {@code key}.
 * <p>/*from  w  w w  .ja  v a2  s  .co  m*/
 * See http://redis.io/commands/type
 * 
 * @param key key
 * @return DataType
 */
public static DataType type(byte[] key) {
    return redisTemplate.execute(new RedisCallback<DataType>() {
        @Override
        public DataType doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.type(key);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Determine the type stored at {@code key}.
 * <p>//from w ww .  jav a 2s  .c o m
 * See http://redis.io/commands/type
 * 
 * @param key key
 * @return DataType
 */
public DataType type(byte[] key) {
    return redisTemplate.execute(new RedisCallback<DataType>() {
        @Override
        public DataType doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.type(key);
        }
    });
}