Class FlowableScalarXMap


  • public final class FlowableScalarXMap
    extends java.lang.Object
    Utility classes to work with scalar-sourced XMap operators (where X == { flat, concat, switch }).
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  FlowableScalarXMap.ScalarXMapFlowable<T,​R>
      Maps a scalar value to a Publisher and subscribes to it.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FlowableScalarXMap()
      Utility class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​U>
      Flowable<U>
      scalarXMap​(T value, Function<? super T,​? extends org.reactivestreams.Publisher<? extends U>> mapper)
      Maps a scalar value into a Publisher and emits its values.
      static <T,​R>
      boolean
      tryScalarXMapSubscribe​(org.reactivestreams.Publisher<T> source, org.reactivestreams.Subscriber<? super R> subscriber, Function<? super T,​? extends org.reactivestreams.Publisher<? extends R>> mapper)
      Tries to subscribe to a possibly Supplier source's mapped Publisher.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlowableScalarXMap

        private FlowableScalarXMap()
        Utility class.
    • Method Detail

      • tryScalarXMapSubscribe

        public static <T,​R> boolean tryScalarXMapSubscribe​(org.reactivestreams.Publisher<T> source,
                                                                 org.reactivestreams.Subscriber<? super R> subscriber,
                                                                 Function<? super T,​? extends org.reactivestreams.Publisher<? extends R>> mapper)
        Tries to subscribe to a possibly Supplier source's mapped Publisher.
        Type Parameters:
        T - the input value type
        R - the output value type
        Parameters:
        source - the source Publisher
        subscriber - the subscriber
        mapper - the function mapping a scalar value into a Publisher
        Returns:
        true if successful, false if the caller should continue with the regular path.
      • scalarXMap

        public static <T,​U> Flowable<U> scalarXMap​(T value,
                                                         Function<? super T,​? extends org.reactivestreams.Publisher<? extends U>> mapper)
        Maps a scalar value into a Publisher and emits its values.
        Type Parameters:
        T - the scalar value type
        U - the output value type
        Parameters:
        value - the scalar value to map
        mapper - the function that gets the scalar value and should return a Publisher that gets streamed
        Returns:
        the new Flowable instance