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

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

Introduction

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

Prototype

@Nullable
Boolean isMember(K key, Object o);

Source Link

Document

Check if set at key contains value .

Usage

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

/**
 * Check if value is part of a set//from   w  w  w.  j a v a  2  s.c  o m
 * @param key
 * @param value
 * @return 
 */
public boolean isMemberUsingOpsForSet(String key, Object value) {
    SetOperations opsForSet = redisTemplate.opsForSet();
    return opsForSet.isMember(key, value);
}