Class FlowInterop


  • public final class FlowInterop
    extends Object
    Converters to and from Java 9 Flow components.
    Since:
    0.1.0
    • Method Detail

      • fromFlowPublisher

        public static <T> io.reactivex.Flowable<T> fromFlowPublisher​(Flow.Publisher<T> source)
        Wraps a Flow.Publisher into a Flowable.
        Type Parameters:
        T - the value type
        Parameters:
        source - the source Flow.Publisher, not null
        Returns:
        the new Flowable instance
        Throws:
        NullPointerException - if source is null
      • toFlow

        public static <T> io.reactivex.functions.Function<io.reactivex.Flowable<T>,​Flow.Publisher<T>> toFlow()
        Converter function from a Flowable into a Publisher.
        Type Parameters:
        T - the value type
        Returns:
        the Function instance to be used with Flowable.to().
      • fromFlowProcessor

        public static <T> io.reactivex.processors.FlowableProcessor<T> fromFlowProcessor​(Flow.Processor<T,​T> source)
        Wraps a Flow.Processor (identity) into a FlowableProcessor.
        Type Parameters:
        T - the input and output type of the Flow.Processor
        Parameters:
        source - the source Flow.Processor, not null
        Returns:
        the new FlowableProcessor instance
        Throws:
        NullPointerException - if source is null
      • toFlowPublisher

        public static <T> Flow.Publisher<T> toFlowPublisher​(Publisher<T> source)
        Wraps an RS Publisher into a Flow.Publisher.
        Type Parameters:
        T - the value type
        Parameters:
        source - the source RS Publisher instance, not null
        Returns:
        the new Flow.Publisher instance
        Throws:
        NullPointerException - if source is null
      • toFlowProcessor

        public static <T,​R> Flow.Processor<T,​R> toFlowProcessor​(Processor<T,​R> source)
        Wraps an RS Processor into a Flow.Processor.
        Type Parameters:
        T - the input value type
        R - the output value type
        Parameters:
        source - the source RS Processor
        Returns:
        the new Flow.Processor instance
        Throws:
        NullPointerException - if source is null