- Type Parameters:
R
- the requested type
- All Superinterfaces:
BiFunction<Flow.Publisher<DataChunk>,
Class<? super R>, CompletionStage<? extends R>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Deprecated
public interface Reader<R>
extends BiFunction<Flow.Publisher<DataChunk>,Class<? super R>,CompletionStage<? extends R>>
Deprecated.
The Reader transforms a
DataChunk
publisher into a completion stage of the associated type.-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletionStage<? extends R>
apply
(Flow.Publisher<DataChunk> publisher) Deprecated.Transforms a publisher into a completion stage.CompletionStage<? extends R>
apply
(Flow.Publisher<DataChunk> publisher, Class<? super R> clazz) Deprecated.Transforms a publisher into a completion stage.default <T extends R>
CompletionStage<? extends T>applyAndCast
(Flow.Publisher<DataChunk> publisher, Class<T> type) Deprecated.Transforms a publisher into a completion stage.Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
apply
Deprecated.Transforms a publisher into a completion stage. If an exception is thrown, the resulting completion stage ofContent.as(Class)
method call ends exceptionally.- Specified by:
apply
in interfaceBiFunction<Flow.Publisher<DataChunk>,
Class<? super R>, CompletionStage<? extends R>> - Parameters:
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.- Returns:
- the result as a completion stage
-
apply
Deprecated.Transforms a publisher into a completion stage. If an exception is thrown, the resulting completion stage ofContent.as(Class)
method call ends exceptionally.The default implementation calls
apply(Flow.Publisher, Class)
withObject
as the class parameter.- Parameters:
publisher
- the publisher to transform- Returns:
- the result as a completion stage
-
applyAndCast
default <T extends R> CompletionStage<? extends T> applyAndCast(Flow.Publisher<DataChunk> publisher, Class<T> type) Deprecated.Transforms a publisher into a completion stage. If an exception is thrown, the resulting completion stage ofContent.as(Class)
method call ends exceptionally.The default implementation calls
apply(Flow.Publisher, Class)
withObject
as the class parameter.- Type Parameters:
T
- the desired type to cast the guarantiedR
type to- Parameters:
publisher
- the publisher to transformtype
- the desired type to cast the guarantiedR
type to- Returns:
- the result as a completion stage which might end exceptionally with
ClassCastException
if theR
type wasn't possible to cast toT
-
io.helidon.media.common.MessageBodyReader
instead