Example usage for org.springframework.core.codec Hints merge

List of usage examples for org.springframework.core.codec Hints merge

Introduction

In this page you can find the example usage for org.springframework.core.codec Hints merge.

Prototype

public static Map<String, Object> merge(Map<String, Object> hints1, Map<String, Object> hints2) 

Source Link

Document

Merge two maps of hints, creating and copying into a new map if both have values, or returning the non-empty map, or an empty map if both are empty.

Usage

From source file:org.springframework.http.codec.DecoderHttpMessageReader.java

@Override
public Flux<T> read(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request,
        ServerHttpResponse response, Map<String, Object> hints) {

    Map<String, Object> allHints = Hints.merge(hints, getReadHints(actualType, elementType, request, response));

    return read(elementType, request, allHints);
}

From source file:org.springframework.http.codec.DecoderHttpMessageReader.java

@Override
public Mono<T> readMono(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request,
        ServerHttpResponse response, Map<String, Object> hints) {

    Map<String, Object> allHints = Hints.merge(hints, getReadHints(actualType, elementType, request, response));

    return readMono(elementType, request, allHints);
}

From source file:org.springframework.http.codec.EncoderHttpMessageWriter.java

@Override
public Mono<Void> write(Publisher<? extends T> inputStream, ResolvableType actualType,
        ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request,
        ServerHttpResponse response, Map<String, Object> hints) {

    Map<String, Object> allHints = Hints.merge(hints,
            getWriteHints(actualType, elementType, mediaType, request, response));

    return write(inputStream, elementType, mediaType, response, allHints);
}