Example usage for org.springframework.data.redis.core SetOperations size

List of usage examples for org.springframework.data.redis.core SetOperations size

Introduction

In this page you can find the example usage for org.springframework.data.redis.core SetOperations size.

Prototype

@Nullable
Long size(K key);

Source Link

Document

Get size of set at key .

Usage

From source file:com.company.project.service.dao.RedisDao.java

/**
 * get number of elements of a set/*from www . j a  v  a 2s .  co  m*/
 * @param key
 * @return 
 */
public long sizeUsingOpsForSet(String key) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.size(key);
}