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

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

Introduction

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

Prototype

@Nullable
Long add(K key, V... values);

Source Link

Document

Add given values to set at key .

Usage

From source file:com.easarrive.datasource.redis.etago.AbstractDaoByRedisTemplate.java

public Long setAdd(K key, V... beans) {
    SetOperations<K, V> setOperations = redisTemplate.opsForSet();
    Long count = setOperations.add(key, beans);
    return count;
}

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

/**
 * Add value to set/*from   ww  w  .j  a va2s. c  o  m*/
 * @param key
 * @param value
 * @return 
 */
public long addUsingOpsForSet(String key, Object value) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.add(key, value);
}