public abstract class Marshaller<A,B>
extends java.lang.Object
Constructor and Description |
---|
Marshaller() |
Modifier and Type | Method and Description |
---|---|
abstract scala.concurrent.Future<scala.collection.immutable.List<Marshalling<B>>> |
apply(A value,
scala.concurrent.ExecutionContext ec) |
static Marshaller<byte[],RequestEntity> |
ByteArrayMarshaller() |
static Marshaller<byte[],RequestEntity> |
byteArrayMarshaller(ContentType contentType) |
static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> |
ByteStringMarshaller() |
static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> |
byteStringMarshaller(ContentType contentType) |
static Marshaller<char[],RequestEntity> |
CharArrayMarshaller() |
static Marshaller<char[],RequestEntity> |
charArrayMarshaller(MediaType.WithFixedCharset mediaType) |
static Marshaller<char[],RequestEntity> |
charArrayMarshaller(MediaType.WithOpenCharset mediaType) |
static <A,B,C> Marshaller<A,C> |
combined(scala.Function1<A,B> marshal,
Marshaller<B,C> m2)
Helper for creating a
Marshaller combined of the provided marshal function
and an implicit Marshaller which is able to produce the required final type. |
<C> Marshaller<C,B> |
compose(scala.Function1<C,A> f) |
<C> Marshaller<C,B> |
composeWithEC(scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<C,A>> f) |
static Marshaller<org.apache.pekko.Done,RequestEntity> |
DoneMarshaller() |
static <A1,A2,B> Marshaller<scala.util.Either<A1,A2>,B> |
eitherMarshaller(Marshaller<A1,B> m1,
Marshaller<A2,B> m2) |
static Marshaller<FormData,RequestEntity> |
FormDataMarshaller() |
static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> |
fromEntityStreamingSupportAndByteStringMarshaller(scala.reflect.ClassTag<T> evidence$1,
EntityStreamingSupport s,
Marshaller<T,org.apache.pekko.util.ByteString> m) |
static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> |
fromEntityStreamingSupportAndByteStringSourceMarshaller(EntityStreamingSupport s,
Marshaller<T,org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,?>> m,
scala.reflect.ClassTag<T> evidence$2) |
static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> |
fromEntityStreamingSupportAndEntityMarshaller(EntityStreamingSupport s,
Marshaller<T,RequestEntity> m,
scala.reflect.ClassTag<T> tag) |
static <T> Marshaller<scala.Tuple4<HttpMethod,Uri,scala.collection.immutable.Seq<HttpHeader>,T>,HttpRequest> |
fromMethodAndUriAndHeadersAndValue(Marshaller<T,RequestEntity> mt) |
static <S,T> Marshaller<scala.Tuple3<HttpMethod,Uri,T>,HttpRequest> |
fromMethodAndUriAndValue(Marshaller<T,RequestEntity> mt) |
static Marshaller<HttpRequest,HttpRequest> |
fromRequest() |
static Marshaller<HttpResponse,HttpResponse> |
fromResponse() |
static Marshaller<StatusCode,HttpResponse> |
fromStatusCode() |
static Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse> |
fromStatusCodeAndHeaders() |
static <T> Marshaller<scala.Tuple3<StatusCode,scala.collection.immutable.Seq<HttpHeader>,T>,HttpResponse> |
fromStatusCodeAndHeadersAndValue(Marshaller<T,RequestEntity> mt) |
static <S,T> Marshaller<scala.Tuple2<S,T>,HttpResponse> |
fromStatusCodeAndValue(scala.Function1<S,StatusCode> sConv,
Marshaller<T,RequestEntity> mt) |
static <S,T> Marshaller<scala.Tuple3<S,scala.collection.immutable.Seq<HttpHeader>,T>,HttpResponse> |
fromStatusCodeConvertibleAndHeadersAndT(scala.Function1<S,StatusCode> sConv,
Marshaller<T,RequestEntity> mt) |
static <T> Marshaller<T,HttpResponse> |
fromToEntityMarshaller(StatusCode status,
scala.collection.immutable.Seq<HttpHeader> headers,
Marshaller<T,RequestEntity> m) |
static <T> StatusCode |
fromToEntityMarshaller$default$1() |
static <T> scala.collection.immutable.Seq<HttpHeader> |
fromToEntityMarshaller$default$2() |
static Marshaller<Uri,HttpRequest> |
fromUri() |
static <A,B> Marshaller<scala.concurrent.Future<A>,B> |
futureMarshaller(Marshaller<A,B> m) |
static <T> Marshaller<T,HttpResponse> |
liftMarshaller(Marshaller<T,RequestEntity> m) |
static <T> Marshaller<T,HttpResponse> |
liftMarshallerConversion(Marshaller<T,RequestEntity> m) |
<C> Marshaller<A,C> |
map(scala.Function1<B,C> f) |
static Marshaller<RequestEntity,RequestEntity> |
MessageEntityMarshaller() |
protected static int |
multipartBoundaryLength() |
protected static java.util.Random |
multipartBoundaryRandom() |
static <T extends Multipart> |
multipartMarshaller(org.apache.pekko.event.LoggingAdapter log) |
static <T extends Multipart> |
multipartMarshaller$default$1() |
static <A,B> Marshaller<A,B> |
oneOf(scala.collection.immutable.Seq<Marshaller<A,B>> marshallers)
Helper for creating a "super-marshaller" from a number of "sub-marshallers".
|
static <T,A,B> Marshaller<A,B> |
oneOf(scala.collection.immutable.Seq<T> values,
scala.Function1<T,Marshaller<A,B>> f)
Helper for creating a "super-marshaller" from a number of values and a function producing "sub-marshallers"
from these values.
|
static <A,B> Marshaller<A,B> |
opaque(scala.Function1<A,B> marshal)
Helper for creating a synchronous
Marshaller to non-negotiable content from the given function. |
static <A,B> Marshaller<scala.Option<A>,B> |
optionMarshaller(Marshaller<A,B> m,
EmptyValue<B> empty) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$ByteArrayMarshaller_$eq(Marshaller<byte[],RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$ByteStringMarshaller_$eq(Marshaller<org.apache.pekko.util.ByteString,RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$CharArrayMarshaller_$eq(Marshaller<char[],RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$DoneMarshaller_$eq(Marshaller<org.apache.pekko.Done,RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$FormDataMarshaller_$eq(Marshaller<FormData,RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$MessageEntityMarshaller_$eq(Marshaller<RequestEntity,RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$StringMarshaller_$eq(Marshaller<java.lang.String,RequestEntity> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToRequestMarshallers$_setter_$fromRequest_$eq(Marshaller<HttpRequest,HttpRequest> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromResponse_$eq(Marshaller<HttpResponse,HttpResponse> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromStatusCode_$eq(Marshaller<StatusCode,HttpResponse> x$1) |
protected abstract static void |
org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromStatusCodeAndHeaders_$eq(Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse> x$1) |
protected static java.lang.String |
randomBoundary() |
static <A,B> Marshaller<A,B> |
strict(scala.Function1<A,Marshalling<B>> f)
Helper for creating a
Marshaller using the given function. |
static Marshaller<java.lang.String,RequestEntity> |
StringMarshaller() |
static Marshaller<java.lang.String,RequestEntity> |
stringMarshaller(MediaType.WithFixedCharset mediaType) |
static Marshaller<java.lang.String,RequestEntity> |
stringMarshaller(MediaType.WithOpenCharset mediaType) |
static <T> Marshaller<java.lang.Throwable,T> |
throwableMarshaller() |
static <A,B> Marshaller<scala.util.Try<A>,B> |
tryMarshaller(Marshaller<A,B> m) |
static <A,B> Marshaller<A,B> |
withFixedContentType(ContentType contentType,
scala.Function1<A,B> marshal)
Helper for creating a synchronous
Marshaller to content with a fixed charset from the given function. |
static <A,B> Marshaller<A,B> |
withOpenCharset(MediaType.WithOpenCharset mediaType,
scala.Function2<A,HttpCharset,B> marshal)
Helper for creating a synchronous
Marshaller to content with a negotiable charset from the given function. |
<C,D> Marshaller<C,D> |
wrap(MediaType newMediaType,
scala.Function1<C,A> f,
ContentTypeOverrider<D> mto)
Reuses this Marshaller's logic to produce a new Marshaller from another type
C which overrides
the pekko.http.scaladsl.model.MediaType of the marshalling result with the given one. |
<C,D> Marshaller<C,D> |
wrapWithEC(MediaType newMediaType,
scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<C,A>> f,
ContentTypeOverrider<D> cto)
Reuses this Marshaller's logic to produce a new Marshaller from another type
C which overrides
the pekko.http.scaladsl.model.MediaType of the marshalling result with the given one. |
public static Marshaller<HttpRequest,HttpRequest> fromRequest()
public static Marshaller<HttpResponse,HttpResponse> fromResponse()
public static Marshaller<StatusCode,HttpResponse> fromStatusCode()
public static Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse> fromStatusCodeAndHeaders()
public static Marshaller<byte[],RequestEntity> ByteArrayMarshaller()
public static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> ByteStringMarshaller()
public static Marshaller<char[],RequestEntity> CharArrayMarshaller()
public static Marshaller<org.apache.pekko.Done,RequestEntity> DoneMarshaller()
public static Marshaller<java.lang.String,RequestEntity> StringMarshaller()
public static Marshaller<FormData,RequestEntity> FormDataMarshaller()
public static Marshaller<RequestEntity,RequestEntity> MessageEntityMarshaller()
public static <A,B> Marshaller<A,B> strict(scala.Function1<A,Marshalling<B>> f)
Marshaller
using the given function.f
- (undocumented)public static <A,B> Marshaller<A,B> oneOf(scala.collection.immutable.Seq<Marshaller<A,B>> marshallers)
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.
marshallers
- (undocumented)public static <T,A,B> Marshaller<A,B> oneOf(scala.collection.immutable.Seq<T> values, scala.Function1<T,Marshaller<A,B>> f)
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.
values
- (undocumented)f
- (undocumented)public static <A,B> Marshaller<A,B> withFixedContentType(ContentType contentType, scala.Function1<A,B> marshal)
Marshaller
to content with a fixed charset from the given function.contentType
- (undocumented)marshal
- (undocumented)public static <A,B> Marshaller<A,B> withOpenCharset(MediaType.WithOpenCharset mediaType, scala.Function2<A,HttpCharset,B> marshal)
Marshaller
to content with a negotiable charset from the given function.mediaType
- (undocumented)marshal
- (undocumented)public static <A,B> Marshaller<A,B> opaque(scala.Function1<A,B> marshal)
Marshaller
to non-negotiable content from the given function.marshal
- (undocumented)public static <A,B,C> Marshaller<A,C> combined(scala.Function1<A,B> marshal, Marshaller<B,C> m2)
Marshaller
combined of the provided marshal
function
and an implicit Marshaller which is able to produce the required final type.marshal
- (undocumented)m2
- (undocumented)public static <T> Marshaller<T,HttpResponse> liftMarshallerConversion(Marshaller<T,RequestEntity> m)
public static <T> Marshaller<T,HttpResponse> liftMarshaller(Marshaller<T,RequestEntity> m)
public static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> fromEntityStreamingSupportAndEntityMarshaller(EntityStreamingSupport s, Marshaller<T,RequestEntity> m, scala.reflect.ClassTag<T> tag)
public static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> fromEntityStreamingSupportAndByteStringSourceMarshaller(EntityStreamingSupport s, Marshaller<T,org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,?>> m, scala.reflect.ClassTag<T> evidence$2)
public static <T> Marshaller<java.lang.Throwable,T> throwableMarshaller()
public static <A,B> Marshaller<scala.Option<A>,B> optionMarshaller(Marshaller<A,B> m, EmptyValue<B> empty)
public static <A1,A2,B> Marshaller<scala.util.Either<A1,A2>,B> eitherMarshaller(Marshaller<A1,B> m1, Marshaller<A2,B> m2)
public static <A,B> Marshaller<scala.concurrent.Future<A>,B> futureMarshaller(Marshaller<A,B> m)
public static <A,B> Marshaller<scala.util.Try<A>,B> tryMarshaller(Marshaller<A,B> m)
public static <T extends Multipart> Marshaller<T,RequestEntity> multipartMarshaller(org.apache.pekko.event.LoggingAdapter log)
public static <T extends Multipart> org.apache.pekko.event.LoggingAdapter multipartMarshaller$default$1()
protected static java.util.Random multipartBoundaryRandom()
protected static int multipartBoundaryLength()
protected static java.lang.String randomBoundary()
public static Marshaller<byte[],RequestEntity> byteArrayMarshaller(ContentType contentType)
public static Marshaller<org.apache.pekko.util.ByteString,RequestEntity> byteStringMarshaller(ContentType contentType)
public static Marshaller<char[],RequestEntity> charArrayMarshaller(MediaType.WithOpenCharset mediaType)
public static Marshaller<char[],RequestEntity> charArrayMarshaller(MediaType.WithFixedCharset mediaType)
public static Marshaller<java.lang.String,RequestEntity> stringMarshaller(MediaType.WithOpenCharset mediaType)
public static Marshaller<java.lang.String,RequestEntity> stringMarshaller(MediaType.WithFixedCharset mediaType)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$ByteArrayMarshaller_$eq(Marshaller<byte[],RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$ByteStringMarshaller_$eq(Marshaller<org.apache.pekko.util.ByteString,RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$CharArrayMarshaller_$eq(Marshaller<char[],RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$DoneMarshaller_$eq(Marshaller<org.apache.pekko.Done,RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$StringMarshaller_$eq(Marshaller<java.lang.String,RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$FormDataMarshaller_$eq(Marshaller<FormData,RequestEntity> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToEntityMarshallers$_setter_$MessageEntityMarshaller_$eq(Marshaller<RequestEntity,RequestEntity> x$1)
public static <T> Marshaller<T,HttpResponse> fromToEntityMarshaller(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, Marshaller<T,RequestEntity> m)
public static <T> StatusCode fromToEntityMarshaller$default$1()
public static <T> scala.collection.immutable.Seq<HttpHeader> fromToEntityMarshaller$default$2()
public static <S,T> Marshaller<scala.Tuple2<S,T>,HttpResponse> fromStatusCodeAndValue(scala.Function1<S,StatusCode> sConv, Marshaller<T,RequestEntity> mt)
public static <S,T> Marshaller<scala.Tuple3<S,scala.collection.immutable.Seq<HttpHeader>,T>,HttpResponse> fromStatusCodeConvertibleAndHeadersAndT(scala.Function1<S,StatusCode> sConv, Marshaller<T,RequestEntity> mt)
public static <T> Marshaller<scala.Tuple3<StatusCode,scala.collection.immutable.Seq<HttpHeader>,T>,HttpResponse> fromStatusCodeAndHeadersAndValue(Marshaller<T,RequestEntity> mt)
public static <T,M> Marshaller<org.apache.pekko.stream.scaladsl.Source<T,M>,HttpResponse> fromEntityStreamingSupportAndByteStringMarshaller(scala.reflect.ClassTag<T> evidence$1, EntityStreamingSupport s, Marshaller<T,org.apache.pekko.util.ByteString> m)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromResponse_$eq(Marshaller<HttpResponse,HttpResponse> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromStatusCode_$eq(Marshaller<StatusCode,HttpResponse> x$1)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToResponseMarshallers$_setter_$fromStatusCodeAndHeaders_$eq(Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse> x$1)
public static Marshaller<Uri,HttpRequest> fromUri()
public static <S,T> Marshaller<scala.Tuple3<HttpMethod,Uri,T>,HttpRequest> fromMethodAndUriAndValue(Marshaller<T,RequestEntity> mt)
public static <T> Marshaller<scala.Tuple4<HttpMethod,Uri,scala.collection.immutable.Seq<HttpHeader>,T>,HttpRequest> fromMethodAndUriAndHeadersAndValue(Marshaller<T,RequestEntity> mt)
protected abstract static void org$apache$pekko$http$scaladsl$marshalling$PredefinedToRequestMarshallers$_setter_$fromRequest_$eq(Marshaller<HttpRequest,HttpRequest> x$1)
public abstract scala.concurrent.Future<scala.collection.immutable.List<Marshalling<B>>> apply(A value, scala.concurrent.ExecutionContext ec)
public <C> Marshaller<A,C> map(scala.Function1<B,C> f)
public <C,D> Marshaller<C,D> wrap(MediaType newMediaType, scala.Function1<C,A> f, ContentTypeOverrider<D> mto)
C
which overrides
the pekko.http.scaladsl.model.MediaType
of the marshalling result with the given one.
Note that not all wrappings are legal. f the underlying pekko.http.scaladsl.model.MediaType
has constraints with regard to the
charsets it allows the new pekko.http.scaladsl.model.MediaType
must be compatible, since pekko-http will never recode entities.
If the wrapping is illegal the Future
produced by the resulting marshaller will contain a RuntimeException
.newMediaType
- (undocumented)f
- (undocumented)mto
- (undocumented)public <C,D> Marshaller<C,D> wrapWithEC(MediaType newMediaType, scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<C,A>> f, ContentTypeOverrider<D> cto)
C
which overrides
the pekko.http.scaladsl.model.MediaType
of the marshalling result with the given one.
Note that not all wrappings are legal. f the underlying pekko.http.scaladsl.model.MediaType
has constraints with regard to the
charsets it allows the new pekko.http.scaladsl.model.MediaType
must be compatible, since pekko-http will never recode entities.
If the wrapping is illegal the Future
produced by the resulting marshaller will contain a RuntimeException
.newMediaType
- (undocumented)f
- (undocumented)cto
- (undocumented)public <C> Marshaller<C,B> compose(scala.Function1<C,A> f)
public <C> Marshaller<C,B> composeWithEC(scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<C,A>> f)