Example usage for org.springframework.data.redis.support.collections RedisList addAll

List of usage examples for org.springframework.data.redis.support.collections RedisList addAll

Introduction

In this page you can find the example usage for org.springframework.data.redis.support.collections RedisList addAll.

Prototype

boolean addAll(Collection<? extends E> c);

Source Link

Document

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

Usage

From source file:org.springframework.integration.redis.outbound.RedisCollectionPopulatingMessageHandler.java

@SuppressWarnings("unchecked")
private void handleList(RedisList<Object> list, Message<?> message) {
    Object payload = message.getPayload();
    if (this.extractPayloadElements) {
        if (payload instanceof Collection<?>) {
            list.addAll((Collection<? extends Object>) payload);
        } else {/*w ww . j a  v  a  2  s. c  o  m*/
            list.add(payload);
        }
    } else {
        list.add(payload);
    }
}

From source file:org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler.java

@SuppressWarnings("unchecked")
private void writeToList(RedisList<Object> list, Message<?> message) {
    Object payload = message.getPayload();
    if (this.extractPayloadElements) {
        if (payload instanceof Collection<?>) {
            list.addAll((Collection<? extends Object>) payload);
        } else {//from  w  w  w . j a v a  2s. co  m
            list.add(payload);
        }
    } else {
        list.add(payload);
    }
}