Example usage for org.springframework.data.redis.connection StringRedisConnection sAdd

List of usage examples for org.springframework.data.redis.connection StringRedisConnection sAdd

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection StringRedisConnection sAdd.

Prototype

Long sAdd(String key, String... values);

Source Link

Document

Add given values to set at key .

Usage

From source file:com.ge.predix.acs.policy.evaluation.cache.RedisPolicyEvaluationCache.java

@Override
void setResourceTranslations(final Set<String> fromKeys, final String toKey) {
    this.redisTemplate.execute(new RedisCallback<List<Object>>() {
        @Override/*from   w w w . j a v a  2 s.c  o m*/
        public List<Object> doInRedis(final RedisConnection connection) throws DataAccessException {
            StringRedisConnection stringRedisConn = new DefaultStringRedisConnection(connection);
            for (String fromKey : fromKeys) {
                stringRedisConn.sAdd(fromKey, toKey);
            }
            return null;
        }
    });
}