Class Unmarshaller<A,​B>

  • All Implemented Interfaces:
    UnmarshallerBase<A,​B>

    public abstract class Unmarshaller<A,​B>
    extends java.lang.Object
    implements UnmarshallerBase<A,​B>
    An unmarshaller transforms values of type A into type B.
    • Constructor Detail

      • Unmarshaller

        public Unmarshaller()
    • Method Detail

      • async

        public static <A,​B> Unmarshaller<A,​B> async​(java.util.function.Function<A,​java.util.concurrent.CompletionStage<B>> f)
        Creates an unmarshaller from an asynchronous Java function.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • sync

        public static <A,​B> Unmarshaller<A,​B> sync​(java.util.function.Function<A,​B> f)
        Creates an unmarshaller from a Java function.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • asScalaCastInput

        public <I> Unmarshaller<I,​B> asScalaCastInput()
        INTERNAL API
      • unmarshal

        public java.util.concurrent.CompletionStage<B> unmarshal​(A value,
                                                                 scala.concurrent.ExecutionContext ec,
                                                                 akka.stream.Materializer mat)
        Apply this Unmarshaller to the given value.
        Parameters:
        value - (undocumented)
        ec - (undocumented)
        mat - (undocumented)
        Returns:
        (undocumented)
      • unmarshal

        public java.util.concurrent.CompletionStage<B> unmarshal​(A value,
                                                                 akka.stream.Materializer mat)
        Apply this Unmarshaller to the given value. Uses the default materializer ExecutionContext. 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 java.util.concurrent.CompletionStage<B> unmarshal​(A value,
                                                                 scala.concurrent.ExecutionContext ec,
                                                                 akka.actor.ClassicActorSystemProvider system)
        Apply this Unmarshaller to the given value.
        Parameters:
        value - (undocumented)
        ec - (undocumented)
        system - (undocumented)
        Returns:
        (undocumented)
      • unmarshal

        public java.util.concurrent.CompletionStage<B> unmarshal​(A value,
                                                                 akka.actor.ClassicActorSystemProvider system)
        Apply this Unmarshaller to the given value. Uses the default materializer ExecutionContext. 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

        public <C> Unmarshaller<A,​C> thenApply​(java.util.function.Function<B,​C> f)
        Transform the result B of this unmarshaller to a C producing a marshaller that turns As into Cs

        Parameters:
        f - (undocumented)
        Returns:
        A new marshaller that can unmarshall instances of A into instances of C
      • flatMap

        public <C> Unmarshaller<A,​C> flatMap​(java.util.function.Function<B,​java.util.concurrent.CompletionStage<C>> f)