Package akka.http.javadsl.unmarshalling
Class Unmarshaller<A,B>
java.lang.Object
akka.http.javadsl.unmarshalling.Unmarshaller<A,B>
- All Implemented Interfaces:
UnmarshallerBase<A,
B>
An unmarshaller transforms values of type A into type B.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Unmarshaller<A,
B> asScala()
<I> Unmarshaller<I,
B> INTERNAL APIstatic <A,
B> Unmarshaller<A, B> async
(Function<A, CompletionStage<B>> f) Creates an unmarshaller from an asynchronous Java function.static Unmarshaller<HttpEntity,
byte[]> static Unmarshaller<HttpEntity,
akka.util.ByteString> static Unmarshaller<HttpEntity,
char[]> static Unmarshaller<HttpEntity,
Multipart.FormData> static Unmarshaller<HttpEntity,
String> static Unmarshaller<HttpEntity,
FormData> static <A,
B> Unmarshaller<A, B> firstOf
(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2) static <A,
B> Unmarshaller<A, B> firstOf
(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3) static <A,
B> Unmarshaller<A, B> firstOf
(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3, Unmarshaller<A, B> u4) static <A,
B> Unmarshaller<A, B> firstOf
(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3, Unmarshaller<A, B> u4, Unmarshaller<A, B> u5) <C> Unmarshaller<A,
C> flatMap
(Unmarshaller<? super B, C> u) <C> Unmarshaller<A,
C> flatMap
(Function<B, CompletionStage<C>> f) static <B> Unmarshaller<HttpEntity,
B> forMediaType
(MediaType t, Unmarshaller<HttpEntity, B> um) static <B> Unmarshaller<HttpEntity,
B> forMediaTypes
(Iterable<MediaType> types, Unmarshaller<HttpEntity, B> um) static <A,
B> Unmarshaller<A, B> fromScala
(Unmarshaller<A, B> scalaUnmarshaller) static Unmarshaller<HttpRequest,
RequestEntity> static <A,
B> Unmarshaller<A, B> Creates an unmarshaller from a Java function.<C> Unmarshaller<A,
C> Transform the resultB
of this unmarshaller to aC
producing a marshaller that turnsA
s intoC
sApply this Unmarshaller to the given value.Apply this Unmarshaller to the given value.unmarshal
(A value, scala.concurrent.ExecutionContext ec, akka.actor.ClassicActorSystemProvider system) Apply this Unmarshaller to the given value.Apply this Unmarshaller to the given value.
-
Constructor Details
-
Unmarshaller
public Unmarshaller()
-
-
Method Details
-
fromScala
-
async
Creates an unmarshaller from an asynchronous Java function.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
sync
Creates an unmarshaller from a Java function.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
entityToByteString
-
entityToByteArray
-
entityToCharArray
-
entityToString
-
entityToWwwUrlEncodedFormData
-
entityToMultipartByteRangesUnmarshaller
public static Unmarshaller<HttpEntity,Multipart.ByteRanges> entityToMultipartByteRangesUnmarshaller() -
entityToMultipartFormData
-
requestToEntity
-
forMediaType
public static <B> Unmarshaller<HttpEntity,B> forMediaType(MediaType t, Unmarshaller<HttpEntity, B> um) -
forMediaTypes
public static <B> Unmarshaller<HttpEntity,B> forMediaTypes(Iterable<MediaType> types, Unmarshaller<HttpEntity, B> um) -
firstOf
-
firstOf
public static <A,B> Unmarshaller<A,B> firstOf(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3) -
firstOf
public static <A,B> Unmarshaller<A,B> firstOf(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3, Unmarshaller<A, B> u4) -
firstOf
public static <A,B> Unmarshaller<A,B> firstOf(Unmarshaller<A, B> u1, Unmarshaller<A, B> u2, Unmarshaller<A, B> u3, Unmarshaller<A, B> u4, Unmarshaller<A, B> u5) -
asScala
-
asScalaCastInput
INTERNAL API -
unmarshal
public CompletionStage<B> unmarshal(A value, scala.concurrent.ExecutionContext ec, akka.stream.Materializer mat) Apply this Unmarshaller to the given value.- Parameters:
value
- (undocumented)ec
- (undocumented)mat
- (undocumented)- Returns:
- (undocumented)
-
unmarshal
Apply this Unmarshaller to the given value. Uses the default materializerExecutionContext
. If you expect the marshalling to be heavy, it is suggested to provide a specialized context for those operations.- Parameters:
value
- (undocumented)mat
- (undocumented)- Returns:
- (undocumented)
-
unmarshal
public CompletionStage<B> unmarshal(A value, scala.concurrent.ExecutionContext ec, akka.actor.ClassicActorSystemProvider system) Apply this Unmarshaller to the given value.- Parameters:
value
- (undocumented)ec
- (undocumented)system
- (undocumented)- Returns:
- (undocumented)
-
unmarshal
Apply this Unmarshaller to the given value. Uses the default materializerExecutionContext
. If you expect the marshalling to be heavy, it is suggested to provide a specialized context for those operations.- Parameters:
value
- (undocumented)system
- (undocumented)- Returns:
- (undocumented)
-
thenApply
Transform the resultB
of this unmarshaller to aC
producing a marshaller that turnsA
s intoC
s- Parameters:
f
- (undocumented)- Returns:
- A new marshaller that can unmarshall instances of
A
into instances ofC
-
flatMap
-
flatMap
-