Class Marshaller<A,B> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionMarshaller<A,B> asScala()<C> Marshaller<A,C> INTERNAL API: involves unsafe cast (however is very fast)static <T> Marshaller<T,RequestEntity> static <T> Marshaller<T,HttpResponse> static Marshaller<byte[],RequestEntity> static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> static Marshaller<char[],RequestEntity> <C> Marshaller<C,B> static <A,B1, B2 extends B1> 
 Marshaller<A,B1> downcast(Marshaller<A, B2> m) Safe downcasting of the output type of the marshaller to a superclass.static <A,B1, B2 extends B1> 
 Marshaller<A,B1> downcast(Marshaller<A, B2> m, Class<B1> target) Safe downcasting of the output type of the marshaller to a superclass.static <A> Marshaller<A,HttpResponse> entityToOKResponse(Iterable<HttpHeader> headers, Marshaller<A, ? extends RequestEntity> m) static <A> Marshaller<A,HttpResponse> entityToOKResponse(Marshaller<A, ? extends RequestEntity> m) static <A> Marshaller<A,HttpResponse> entityToResponse(StatusCode status, Iterable<HttpHeader> headers, Marshaller<A, ? extends RequestEntity> m) static <A,R extends RequestEntity> 
 Marshaller<A,HttpResponse> entityToResponse(StatusCode status, Marshaller<A, R> m) static Marshaller<FormData,RequestEntity> static <A,B> Marshaller<A, B> fromScala(Marshaller<A, B> scalaMarshaller) <C> Marshaller<A,C> static <A,B> Marshaller<A, B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2) Helper for creating a "super-marshaller" from a number of "sub-marshallers".static <A,B> Marshaller<A, B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3) Helper for creating a "super-marshaller" from a number of "sub-marshallers".static <A,B> Marshaller<A, B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3, Marshaller<A, B> m4) Helper for creating a "super-marshaller" from a number of "sub-marshallers".static <A,B> Marshaller<A, B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3, Marshaller<A, B> m4, Marshaller<A, B> m5) Helper for creating a "super-marshaller" from a number of "sub-marshallers".static <A,B> Marshaller<A, B> oneOf(scala.collection.immutable.Seq<Marshaller<A, B>> ms) Helper for creating a "super-marshaller" from a number of "sub-marshallers".static <A,B> Marshaller<A, B> Helper for creating a synchronousMarshallerto non-negotiable content from the given function.static <A> Marshaller<Optional<A>,RequestEntity> Marshals an Optional[A] to a RequestEntity an empty optional will yield an empty entity.static Marshaller<String,RequestEntity> static <T> scala.Option<T>static <A,B> Marshaller<A, B> withFixedContentType(ContentType contentType, Function<A, B> f) Helper for creating a synchronousMarshallerto content with a fixed charset from the given function.static <A,B> Marshaller<A, B> withOpenCharset(MediaType.WithOpenCharset mediaType, BiFunction<A, HttpCharset, B> f) Helper for creating a synchronousMarshallerto content with a negotiable charset from the given function.static <A,C> Marshaller<C, RequestEntity> wrapEntity(BiFunction<scala.concurrent.ExecutionContext, C, A> f, Marshaller<A, RequestEntity> m, MediaType mediaType) static <A,C, E extends RequestEntity> 
 Marshaller<C,RequestEntity> wrapEntity(Function<C, A> f, Marshaller<A, E> m, MediaType mediaType) 
- 
Constructor Details- 
Marshallerpublic Marshaller()
 
- 
- 
Method Details- 
fromScala
- 
toOption
- 
downcastSafe downcasting of the output type of the marshaller to a superclass.Marshaller is covariant in B, i.e. if B2 is a subclass of B1, then Marshaller[X,B2] is OK to use where Marshaller[X,B1] is expected. - Parameters:
- m- (undocumented)
- Returns:
- (undocumented)
 
- 
downcastpublic static <A,B1, Marshaller<A,B2 extends B1> B1> downcast(Marshaller<A, B2> m, Class<B1> target) Safe downcasting of the output type of the marshaller to a superclass.Marshaller is covariant in B, i.e. if B2 is a subclass of B1, then Marshaller[X,B2] is OK to use where Marshaller[X,B1] is expected. - Parameters:
- m- (undocumented)
- target- (undocumented)
- Returns:
- (undocumented)
 
- 
stringToEntity
- 
byteArrayToEntity
- 
charArrayToEntity
- 
byteStringToEntity
- 
formDataToEntity
- 
byteStringMarshallerpublic static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> byteStringMarshaller(ContentType t) 
- 
optionMarshallerpublic static <A> Marshaller<Optional<A>,RequestEntity> optionMarshaller(Marshaller<A, RequestEntity> m) Marshals an Optional[A] to a RequestEntity an empty optional will yield an empty entity.- Parameters:
- m- (undocumented)
- Returns:
- (undocumented)
 
- 
wrapEntitypublic static <A,C> Marshaller<C,RequestEntity> wrapEntity(BiFunction<scala.concurrent.ExecutionContext, C, A> f, Marshaller<A, RequestEntity> m, MediaType mediaType) 
- 
wrapEntitypublic static <A,C, Marshaller<C,E extends RequestEntity> RequestEntity> wrapEntity(Function<C, A> f, Marshaller<A, E> m, MediaType mediaType) 
- 
entityToOKResponsepublic static <A> Marshaller<A,HttpResponse> entityToOKResponse(Marshaller<A, ? extends RequestEntity> m) 
- 
entityToResponsepublic static <A,R extends RequestEntity> Marshaller<A,HttpResponse> entityToResponse(StatusCode status, Marshaller<A, R> m) 
- 
entityToResponsepublic static <A> Marshaller<A,HttpResponse> entityToResponse(StatusCode status, Iterable<HttpHeader> headers, Marshaller<A, ? extends RequestEntity> m) 
- 
entityToOKResponsepublic static <A> Marshaller<A,HttpResponse> entityToOKResponse(Iterable<HttpHeader> headers, Marshaller<A, ? extends RequestEntity> m) 
- 
oneOfHelper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.Please note that all passed in marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP. - Parameters:
- ms- (undocumented)
- Returns:
- (undocumented)
 
- 
oneOfHelper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP. - Parameters:
- m1- (undocumented)
- m2- (undocumented)
- Returns:
- (undocumented)
 
- 
oneOfpublic static <A,B> Marshaller<A,B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3) Helper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP. - Parameters:
- m1- (undocumented)
- m2- (undocumented)
- m3- (undocumented)
- Returns:
- (undocumented)
 
- 
oneOfpublic static <A,B> Marshaller<A,B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3, Marshaller<A, B> m4) Helper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP. - Parameters:
- m1- (undocumented)
- m2- (undocumented)
- m3- (undocumented)
- m4- (undocumented)
- Returns:
- (undocumented)
 
- 
oneOfpublic static <A,B> Marshaller<A,B> oneOf(Marshaller<A, B> m1, Marshaller<A, B> m2, Marshaller<A, B> m3, Marshaller<A, B> m4, Marshaller<A, B> m5) Helper for creating a "super-marshaller" from a number of "sub-marshallers". Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.Please note that all marshallers will actually be invoked in order to get the Marshalling object out of them, and later decide which of the marshallings should be returned. This is by-design, however in ticket as discussed in ticket https://github.com/akka/akka-http/issues/243 it MAY be changed in later versions of Pekko HTTP. - Parameters:
- m1- (undocumented)
- m2- (undocumented)
- m3- (undocumented)
- m4- (undocumented)
- m5- (undocumented)
- Returns:
- (undocumented)
 
- 
withFixedContentTypeHelper for creating a synchronousMarshallerto content with a fixed charset from the given function.- Parameters:
- contentType- (undocumented)
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
withOpenCharsetpublic static <A,B> Marshaller<A,B> withOpenCharset(MediaType.WithOpenCharset mediaType, BiFunction<A, HttpCharset, B> f) Helper for creating a synchronousMarshallerto content with a negotiable charset from the given function.- Parameters:
- mediaType- (undocumented)
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
opaqueHelper for creating a synchronousMarshallerto non-negotiable content from the given function.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
asScalaToResponseMarshallerpublic static <T> Marshaller<T,HttpResponse> asScalaToResponseMarshaller(Marshaller<T, HttpResponse> m) 
- 
asScalaEntityMarshallerpublic static <T> Marshaller<T,RequestEntity> asScalaEntityMarshaller(Marshaller<T, RequestEntity> m) 
- 
asScala
- 
asScalaCastOutputINTERNAL API: involves unsafe cast (however is very fast)
- 
map
- 
compose
 
-