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

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

Introduction

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

Prototype

@Nullable
Set<V> union(K key, Collection<K> otherKeys);

Source Link

Document

Union all sets at given keys and otherKeys .

Usage

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

/**
 * Combine element of sets from two keys
 * @param key1/*from  www.  jav  a2s.  c o m*/
 * @param key2
 * @return 
 */
public Set unionUsingOpsForSet(String key1, String key2) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.union(key1, key2);
}