R - the requested typejava.util.function.BiFunction<Flow.Publisher<DataChunk>,java.lang.Class<? super R>,java.util.concurrent.CompletionStage<? extends R>>@FunctionalInterface public interface Reader<R> extends java.util.function.BiFunction<Flow.Publisher<DataChunk>,java.lang.Class<? super R>,java.util.concurrent.CompletionStage<? extends R>>
DataChunk publisher into a completion stage of the associated type.| Modifier and Type | Method | Description |
|---|---|---|
default java.util.concurrent.CompletionStage<? extends R> |
apply(Flow.Publisher<DataChunk> publisher) |
Transforms a publisher into a completion stage.
|
java.util.concurrent.CompletionStage<? extends R> |
apply(Flow.Publisher<DataChunk> publisher,
java.lang.Class<? super R> clazz) |
Transforms a publisher into a completion stage.
|
default <T extends R> |
applyAndCast(Flow.Publisher<DataChunk> publisher,
java.lang.Class<T> type) |
Transforms a publisher into a completion stage.
|
java.util.concurrent.CompletionStage<? extends R> apply(Flow.Publisher<DataChunk> publisher, java.lang.Class<? super R> clazz)
Content.as(Class) method call ends exceptionally.apply in interface java.util.function.BiFunction<Flow.Publisher<DataChunk>,java.lang.Class<? super R>,java.util.concurrent.CompletionStage<? extends R>>publisher - the publisher to transformclazz - the requested type to be returned as a completion stage. The purpose of
this parameter is to know what the user of this Reader actually requested.default java.util.concurrent.CompletionStage<? extends R> apply(Flow.Publisher<DataChunk> publisher)
Content.as(Class) method call ends exceptionally.
The default implementation calls apply(Flow.Publisher, Class) with Object as
the class parameter.
publisher - the publisher to transformdefault <T extends R> java.util.concurrent.CompletionStage<? extends T> applyAndCast(Flow.Publisher<DataChunk> publisher, java.lang.Class<T> type)
Content.as(Class) method call ends exceptionally.
The default implementation calls apply(Flow.Publisher, Class) with Object as
the class parameter.
T - the desired type to cast the guarantied R type topublisher - the publisher to transformtype - the desired type to cast the guarantied R type toClassCastException if the R type wasn't possible to cast
to TCopyright © 2018 Oracle Corporation. All rights reserved.