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

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

Introduction

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

Prototype

@Nullable
Boolean move(K key, V value, K destKey);

Source Link

Document

Move value from key to destKey

Usage

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

/**
 * Transfer a value from one set to another
 * @param fromKey       source set//w w  w  .ja  v  a 2 s  .c o  m
 * @param value         value to transfer
 * @param toKey         destination set
 * @return 
 */
public boolean moveUsingOpsForSet(String fromKey, Object value, String toKey) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.move(fromKey, value, toKey);
}