Class Unmarshaller<A,B>
java.lang.Object
org.apache.pekko.http.javadsl.unmarshalling.Unmarshaller<A,B>
- All Implemented Interfaces:
UnmarshallerBase<A,B>
An unmarshaller transforms values of type A into type B.
-
Nested Class Summary
Nested Classes -
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,org.apache.pekko.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(Function<B, CompletionStage<C>> f) <C> Unmarshaller<A,C> flatMap(Unmarshaller<? super B, C> u) 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 resultBof this unmarshaller to aCproducing a marshaller that turnsAs intoCsApply this Unmarshaller to the given value.Apply this Unmarshaller to the given value.unmarshal(A value, scala.concurrent.ExecutionContext ec, org.apache.pekko.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, org.apache.pekko.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, org.apache.pekko.actor.ClassicActorSystemProvider system) Apply this Unmarshaller to the given value.- Parameters:
value- (undocumented)ec- (undocumented)system- (undocumented)- Returns:
- (undocumented)
-
unmarshal
public CompletionStage<B> unmarshal(A value, org.apache.pekko.actor.ClassicActorSystemProvider system) 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 resultBof this unmarshaller to aCproducing a marshaller that turnsAs intoCs- Parameters:
f- (undocumented)- Returns:
- A new marshaller that can unmarshall instances of
Ainto instances ofC
-
flatMap
-
flatMap
-