public final class ResponseConversionUtil extends Object
HttpResponse.| Modifier and Type | Method and Description |
|---|---|
static HttpResponseWriter |
aggregateFrom(org.reactivestreams.Publisher<?> publisher,
ResponseHeaders headers,
HttpHeaders trailers,
Function<Object,HttpData> contentConverter)
Returns a new
HttpResponseWriter which has a content converted from the collected objects. |
static HttpResponseWriter |
aggregateFrom(Stream<?> stream,
ResponseHeaders headers,
HttpHeaders trailers,
Function<Object,HttpData> contentConverter,
Executor executor)
Returns a new
HttpResponseWriter which has a content converted from the collected objects. |
static <T> HttpResponseWriter |
streamingFrom(org.reactivestreams.Publisher<T> publisher,
ResponseHeaders headers,
HttpHeaders trailers,
Function<T,HttpData> contentConverter)
Returns a new
HttpResponseWriter which sends a streaming response from the specified
Publisher. |
static <T> HttpResponseWriter |
streamingFrom(Stream<T> stream,
ResponseHeaders headers,
HttpHeaders trailers,
Function<T,HttpData> contentConverter,
Executor executor)
Returns a new
HttpResponseWriter which sends a streaming response from the specified
Stream. |
public static HttpResponseWriter aggregateFrom(Stream<?> stream, ResponseHeaders headers, HttpHeaders trailers, Function<Object,HttpData> contentConverter, Executor executor)
HttpResponseWriter which has a content converted from the collected objects.stream - a sequence of objectsheaders - to be written to the returned HttpResponseWritertrailers - to be written to the returned HttpResponseWritercontentConverter - converts the collected objects into a content of the responseexecutor - executes the collecting jobpublic static HttpResponseWriter aggregateFrom(org.reactivestreams.Publisher<?> publisher, ResponseHeaders headers, HttpHeaders trailers, Function<Object,HttpData> contentConverter)
HttpResponseWriter which has a content converted from the collected objects.publisher - publishes objectsheaders - to be written to the returned HttpResponseWritertrailers - to be written to the returned HttpResponseWritercontentConverter - converts the collected objects into a content of the responsepublic static <T> HttpResponseWriter streamingFrom(Stream<T> stream, ResponseHeaders headers, HttpHeaders trailers, Function<T,HttpData> contentConverter, Executor executor)
HttpResponseWriter which sends a streaming response from the specified
Stream.stream - a sequence of objectsheaders - to be written to the returned HttpResponseWritertrailers - to be written to the returned HttpResponseWritercontentConverter - converts the published objects into streaming contents of the responseexecutor - executes the iteration of the streampublic static <T> HttpResponseWriter streamingFrom(org.reactivestreams.Publisher<T> publisher, ResponseHeaders headers, HttpHeaders trailers, Function<T,HttpData> contentConverter)
HttpResponseWriter which sends a streaming response from the specified
Publisher.publisher - publishes objectsheaders - to be written to the returned HttpResponseWritertrailers - to be written to the returned HttpResponseWritercontentConverter - converts the published objects into streaming contents of the responseCopyright © 2020 LeanCloud. All rights reserved.