Package akka.http.scaladsl.marshalling
Class Marshaller$
- java.lang.Object
-
- akka.http.scaladsl.marshalling.Marshaller$
-
- All Implemented Interfaces:
GenericMarshallers
,LowPriorityToResponseMarshallerImplicits
,MultipartMarshallers
,PredefinedToEntityMarshallers
,PredefinedToRequestMarshallers
,PredefinedToResponseMarshallers
public class Marshaller$ extends java.lang.Object implements GenericMarshallers, PredefinedToEntityMarshallers, PredefinedToResponseMarshallers, PredefinedToRequestMarshallers
-
-
Field Summary
Fields Modifier and Type Field Description static Marshaller$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description Marshaller$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A,B>
Marshaller<A,B>apply(scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<A,scala.concurrent.Future<scala.collection.immutable.List<Marshalling<B>>>>> f)
Creates aMarshaller
from the given function.Marshaller<byte[],RequestEntity>
ByteArrayMarshaller()
Marshaller<akka.util.ByteString,RequestEntity>
ByteStringMarshaller()
Marshaller<char[],RequestEntity>
CharArrayMarshaller()
<A,B,C>
Marshaller<A,C>combined(scala.Function1<A,B> marshal, Marshaller<B,C> m2)
Helper for creating aMarshaller
combined of the providedmarshal
function and an implicit Marshaller which is able to produce the required final type.Marshaller<akka.Done,RequestEntity>
DoneMarshaller()
Marshaller<FormData,RequestEntity>
FormDataMarshaller()
Marshaller<HttpRequest,HttpRequest>
fromRequest()
Marshaller<HttpResponse,HttpResponse>
fromResponse()
Marshaller<StatusCode,HttpResponse>
fromStatusCode()
Creates a response for a status code.Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse>
fromStatusCodeAndHeaders()
Creates a response from status code and headers.Marshaller<RequestEntity,RequestEntity>
MessageEntityMarshaller()
<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".<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.<A,B>
Marshaller<A,B>opaque(scala.Function1<A,B> marshal)
Helper for creating a synchronousMarshaller
to non-negotiable content from the given function.<A,B>
Marshaller<A,B>strict(scala.Function1<A,Marshalling<B>> f)
Helper for creating aMarshaller
using the given function.Marshaller<java.lang.String,RequestEntity>
StringMarshaller()
<A,B>
Marshaller<A,B>withFixedContentType(ContentType contentType, scala.Function1<A,B> marshal)
Helper for creating a synchronousMarshaller
to content with a fixed charset from the given function.<A,B>
Marshaller<A,B>withOpenCharset(MediaType.WithOpenCharset mediaType, scala.Function2<A,HttpCharset,B> marshal)
Helper for creating a synchronousMarshaller
to content with a negotiable charset from the given function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.http.scaladsl.marshalling.GenericMarshallers
eitherMarshaller, futureMarshaller, optionMarshaller, throwableMarshaller, tryMarshaller
-
Methods inherited from interface akka.http.scaladsl.marshalling.LowPriorityToResponseMarshallerImplicits
fromEntityStreamingSupportAndByteStringSourceMarshaller, fromEntityStreamingSupportAndEntityMarshaller, liftMarshaller, liftMarshallerConversion
-
Methods inherited from interface akka.http.scaladsl.marshalling.MultipartMarshallers
multipartBoundaryLength, multipartBoundaryRandom, multipartMarshaller, randomBoundary
-
Methods inherited from interface akka.http.scaladsl.marshalling.PredefinedToEntityMarshallers
byteArrayMarshaller, byteStringMarshaller, charArrayMarshaller, charArrayMarshaller, marshalCharArray, stringMarshaller, stringMarshaller
-
Methods inherited from interface akka.http.scaladsl.marshalling.PredefinedToRequestMarshallers
fromMethodAndUriAndHeadersAndValue, fromMethodAndUriAndValue, fromUri
-
Methods inherited from interface akka.http.scaladsl.marshalling.PredefinedToResponseMarshallers
fromEntityStreamingSupportAndByteStringMarshaller, fromStatusCodeAndHeadersAndValue, fromStatusCodeAndValue, fromStatusCodeConvertibleAndHeadersAndT, fromToEntityMarshaller
-
-
-
-
Field Detail
-
MODULE$
public static final Marshaller$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
fromRequest
public Marshaller<HttpRequest,HttpRequest> fromRequest()
- Specified by:
fromRequest
in interfacePredefinedToRequestMarshallers
-
fromResponse
public Marshaller<HttpResponse,HttpResponse> fromResponse()
- Specified by:
fromResponse
in interfacePredefinedToResponseMarshallers
-
fromStatusCode
public Marshaller<StatusCode,HttpResponse> fromStatusCode()
Description copied from interface:PredefinedToResponseMarshallers
Creates a response for a status code. Does not support content-type negotiation but will return a response either with atext-plain
entity containing thestatus.defaultMessage
or an empty entity for status codes that don't allow a response.- Specified by:
fromStatusCode
in interfacePredefinedToResponseMarshallers
- Returns:
- (undocumented)
-
fromStatusCodeAndHeaders
public Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>,HttpResponse> fromStatusCodeAndHeaders()
Description copied from interface:PredefinedToResponseMarshallers
Creates a response from status code and headers. Does not support content-type negotiation but will return a response either with atext-plain
entity containing thestatus.defaultMessage
or an empty entity for status codes that don't allow a response.- Specified by:
fromStatusCodeAndHeaders
in interfacePredefinedToResponseMarshallers
- Returns:
- (undocumented)
-
ByteArrayMarshaller
public Marshaller<byte[],RequestEntity> ByteArrayMarshaller()
- Specified by:
ByteArrayMarshaller
in interfacePredefinedToEntityMarshallers
-
ByteStringMarshaller
public Marshaller<akka.util.ByteString,RequestEntity> ByteStringMarshaller()
- Specified by:
ByteStringMarshaller
in interfacePredefinedToEntityMarshallers
-
CharArrayMarshaller
public Marshaller<char[],RequestEntity> CharArrayMarshaller()
- Specified by:
CharArrayMarshaller
in interfacePredefinedToEntityMarshallers
-
DoneMarshaller
public Marshaller<akka.Done,RequestEntity> DoneMarshaller()
- Specified by:
DoneMarshaller
in interfacePredefinedToEntityMarshallers
-
StringMarshaller
public Marshaller<java.lang.String,RequestEntity> StringMarshaller()
- Specified by:
StringMarshaller
in interfacePredefinedToEntityMarshallers
-
FormDataMarshaller
public Marshaller<FormData,RequestEntity> FormDataMarshaller()
- Specified by:
FormDataMarshaller
in interfacePredefinedToEntityMarshallers
-
MessageEntityMarshaller
public Marshaller<RequestEntity,RequestEntity> MessageEntityMarshaller()
- Specified by:
MessageEntityMarshaller
in interfacePredefinedToEntityMarshallers
-
apply
public <A,B> Marshaller<A,B> apply(scala.Function1<scala.concurrent.ExecutionContext,scala.Function1<A,scala.concurrent.Future<scala.collection.immutable.List<Marshalling<B>>>>> f)
Creates aMarshaller
from the given function.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
strict
public <A,B> Marshaller<A,B> strict(scala.Function1<A,Marshalling<B>> f)
Helper for creating aMarshaller
using the given function.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
oneOf
public <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". 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 Akka HTTP.
- Parameters:
marshallers
- (undocumented)- Returns:
- (undocumented)
-
oneOf
public <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. 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 Akka HTTP.
- Parameters:
values
- (undocumented)f
- (undocumented)- Returns:
- (undocumented)
-
withFixedContentType
public <A,B> Marshaller<A,B> withFixedContentType(ContentType contentType, scala.Function1<A,B> marshal)
Helper for creating a synchronousMarshaller
to content with a fixed charset from the given function.- Parameters:
contentType
- (undocumented)marshal
- (undocumented)- Returns:
- (undocumented)
-
withOpenCharset
public <A,B> Marshaller<A,B> withOpenCharset(MediaType.WithOpenCharset mediaType, scala.Function2<A,HttpCharset,B> marshal)
Helper for creating a synchronousMarshaller
to content with a negotiable charset from the given function.- Parameters:
mediaType
- (undocumented)marshal
- (undocumented)- Returns:
- (undocumented)
-
opaque
public <A,B> Marshaller<A,B> opaque(scala.Function1<A,B> marshal)
Helper for creating a synchronousMarshaller
to non-negotiable content from the given function.- Parameters:
marshal
- (undocumented)- Returns:
- (undocumented)
-
combined
public <A,B,C> Marshaller<A,C> combined(scala.Function1<A,B> marshal, Marshaller<B,C> m2)
Helper for creating aMarshaller
combined of the providedmarshal
function and an implicit Marshaller which is able to produce the required final type.- Parameters:
marshal
- (undocumented)m2
- (undocumented)- Returns:
- (undocumented)
-
-