List of usage examples for org.springframework.data.redis.support.collections RedisSet add
boolean add(E e);
From source file:org.springframework.integration.redis.outbound.RedisCollectionPopulatingMessageHandler.java
@SuppressWarnings("unchecked") private void handleSet(final RedisSet<Object> set, Message<?> message) { final Object payload = message.getPayload(); if (this.extractPayloadElements && payload instanceof Collection<?>) { final BoundSetOperations<String, Object> ops = (BoundSetOperations<String, Object>) this.redisTemplate .boundSetOps(set.getKey()); this.processInPipeline(new PipelineCallback() { public void process() { for (Object object : ((Collection<?>) payload)) { ops.add(object);//from w w w .j a va 2 s. c om } } }); } else { set.add(payload); } }
From source file:org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler.java
@SuppressWarnings("unchecked") private void writeToSet(final RedisSet<Object> set, Message<?> message) { final Object payload = message.getPayload(); if (this.extractPayloadElements && payload instanceof Collection<?>) { final BoundSetOperations<String, Object> ops = (BoundSetOperations<String, Object>) this.redisTemplate .boundSetOps(set.getKey()); this.processInPipeline(new PipelineCallback() { public void process() { for (Object object : ((Collection<?>) payload)) { ops.add(object);//from w ww .j a v a2s. co m } } }); } else { set.add(payload); } }