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

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

Introduction

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

Prototype

@Nullable
V pop(K key);

Source Link

Document

Remove and return a random member from set at key .

Usage

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

public V setPOP(K key) {
    SetOperations<K, V> setOperations = redisTemplate.opsForSet();
    V object = setOperations.pop(key);
    return object;
}

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

/**
 * Get the value and remove from set/*from  w  w  w .jav  a 2s . c  o  m*/
 * @param key
 * @return 
 */
public Object popUsingOpsForSet(String key) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.pop(key);
}