Example usage for org.springframework.data.redis.support.collections RedisMap putAll

List of usage examples for org.springframework.data.redis.support.collections RedisMap putAll

Introduction

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

Prototype

void putAll(Map<? extends K, ? extends V> m);

Source Link

Document

Copies all of the mappings from the specified map to this map (optional operation).

Usage

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

@SuppressWarnings("unchecked")
private void handleMap(final RedisMap<Object, Object> map, Message<?> message) {
    final Object payload = message.getPayload();
    if (this.extractPayloadElements && payload instanceof Map<?, ?>) {
        this.processInPipeline(new PipelineCallback() {
            public void process() {
                map.putAll((Map<? extends Object, ? extends Object>) payload);
            }/*from   w w w. j a  va2  s . com*/
        });
    } else {
        Object key = this.assertMapEntry(message, false);
        map.put(key, payload);
    }
}

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

@SuppressWarnings("unchecked")
private void writeToMap(final RedisMap<Object, Object> map, Message<?> message) {
    final Object payload = message.getPayload();
    if (this.extractPayloadElements && payload instanceof Map<?, ?>) {
        this.processInPipeline(new PipelineCallback() {
            public void process() {
                map.putAll((Map<? extends Object, ? extends Object>) payload);
            }/* w  w w  . j  a  v  a 2 s  .c  om*/
        });
    } else {
        Object key = this.determineMapKey(message, false);
        map.put(key, payload);
    }
}