Class Marshaller$
java.lang.Object
org.apache.pekko.http.scaladsl.marshalling.Marshaller$
- All Implemented Interfaces:
- GenericMarshallers,- LowPriorityToResponseMarshallerImplicits,- MultipartMarshallers,- PredefinedToEntityMarshallers,- PredefinedToRequestMarshallers,- PredefinedToResponseMarshallers
public class Marshaller$
extends Object
implements GenericMarshallers, PredefinedToEntityMarshallers, PredefinedToResponseMarshallers, PredefinedToRequestMarshallers
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Marshaller$Static reference to the singleton instance of this Scala object.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<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 aMarshallerfrom the given function.Marshaller<byte[],RequestEntity> Marshaller<org.apache.pekko.util.ByteString,RequestEntity> Marshaller<char[],RequestEntity> <A,B, C> Marshaller<A, C> combined(scala.Function1<A, B> marshal, Marshaller<B, C> m2) Helper for creating aMarshallercombined of the providedmarshalfunction and an implicit Marshaller which is able to produce the required final type.Marshaller<org.apache.pekko.Done,RequestEntity> Creates a response for a status code.Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>, HttpResponse> Creates a response from status code and headers.<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 synchronousMarshallerto non-negotiable content from the given function.<A,B> Marshaller<A, B> strict(scala.Function1<A, Marshalling<B>> f) Helper for creating aMarshallerusing the given function.<A,B> Marshaller<A, B> withFixedContentType(ContentType contentType, scala.Function1<A, B> marshal) Helper for creating a synchronousMarshallerto 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 synchronousMarshallerto content with a negotiable charset from the given function.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.GenericMarshallerseitherMarshaller, futureMarshaller, optionMarshaller, throwableMarshaller, tryMarshallerMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.LowPriorityToResponseMarshallerImplicitsfromEntityStreamingSupportAndByteStringSourceMarshaller, fromEntityStreamingSupportAndEntityMarshaller, liftMarshaller, liftMarshallerConversionMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.MultipartMarshallersmultipartBoundaryLength, multipartBoundaryRandom, multipartMarshaller, randomBoundaryMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.PredefinedToEntityMarshallersbyteArrayMarshaller, byteStringMarshaller, charArrayMarshaller, charArrayMarshaller, marshalCharArray, stringMarshaller, stringMarshallerMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.PredefinedToRequestMarshallersfromMethodAndUriAndHeadersAndValue, fromMethodAndUriAndValue, fromUriMethods inherited from interface org.apache.pekko.http.scaladsl.marshalling.PredefinedToResponseMarshallersfromEntityStreamingSupportAndByteStringMarshaller, fromStatusCodeAndHeadersAndValue, fromStatusCodeAndValue, fromStatusCodeConvertibleAndHeadersAndT, fromToEntityMarshaller
- 
Field Details- 
MODULE$Static reference to the singleton instance of this Scala object.
 
- 
- 
Constructor Details- 
Marshaller$public Marshaller$()
 
- 
- 
Method Details- 
fromRequest- Specified by:
- fromRequestin interface- PredefinedToRequestMarshallers
 
- 
fromResponse- Specified by:
- fromResponsein interface- PredefinedToResponseMarshallers
 
- 
fromStatusCodeDescription copied from interface:PredefinedToResponseMarshallersCreates a response for a status code. Does not support content-type negotiation but will return a response either with atext-plainentity containing thestatus.defaultMessageor an empty entity for status codes that don't allow a response.- Specified by:
- fromStatusCodein interface- PredefinedToResponseMarshallers
- Returns:
- (undocumented)
 
- 
fromStatusCodeAndHeaderspublic Marshaller<scala.Tuple2<StatusCode,scala.collection.immutable.Seq<HttpHeader>>, fromStatusCodeAndHeaders()HttpResponse> Description copied from interface:PredefinedToResponseMarshallersCreates a response from status code and headers. Does not support content-type negotiation but will return a response either with atext-plainentity containing thestatus.defaultMessageor an empty entity for status codes that don't allow a response.- Specified by:
- fromStatusCodeAndHeadersin interface- PredefinedToResponseMarshallers
- Returns:
- (undocumented)
 
- 
ByteArrayMarshaller- Specified by:
- ByteArrayMarshallerin interface- PredefinedToEntityMarshallers
 
- 
ByteStringMarshaller- Specified by:
- ByteStringMarshallerin interface- PredefinedToEntityMarshallers
 
- 
CharArrayMarshaller- Specified by:
- CharArrayMarshallerin interface- PredefinedToEntityMarshallers
 
- 
DoneMarshaller- Specified by:
- DoneMarshallerin interface- PredefinedToEntityMarshallers
 
- 
StringMarshaller- Specified by:
- StringMarshallerin interface- PredefinedToEntityMarshallers
 
- 
FormDataMarshaller- Specified by:
- FormDataMarshallerin interface- PredefinedToEntityMarshallers
 
- 
MessageEntityMarshaller- Specified by:
- MessageEntityMarshallerin interface- PredefinedToEntityMarshallers
 
- 
applypublic <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 aMarshallerfrom the given function.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
strictHelper for creating aMarshallerusing the given function.- Parameters:
- f- (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:
- marshallers- (undocumented)
- Returns:
- (undocumented)
 
- 
oneOfpublic <T,A, Marshaller<A,B> 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 Pekko HTTP. - Parameters:
- values- (undocumented)
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
withFixedContentTypepublic <A,B> Marshaller<A,B> withFixedContentType(ContentType contentType, scala.Function1<A, B> marshal) Helper for creating a synchronousMarshallerto content with a fixed charset from the given function.- Parameters:
- contentType- (undocumented)
- marshal- (undocumented)
- Returns:
- (undocumented)
 
- 
withOpenCharsetpublic <A,B> Marshaller<A,B> withOpenCharset(MediaType.WithOpenCharset mediaType, scala.Function2<A, HttpCharset, B> marshal) Helper for creating a synchronousMarshallerto content with a negotiable charset from the given function.- Parameters:
- mediaType- (undocumented)
- marshal- (undocumented)
- Returns:
- (undocumented)
 
- 
opaqueHelper for creating a synchronousMarshallerto non-negotiable content from the given function.- Parameters:
- marshal- (undocumented)
- Returns:
- (undocumented)
 
- 
combinedHelper for creating aMarshallercombined of the providedmarshalfunction and an implicit Marshaller which is able to produce the required final type.- Parameters:
- marshal- (undocumented)
- m2- (undocumented)
- Returns:
- (undocumented)
 
 
-