Module mutiny.zero

Class Transform<I,​O>

  • Type Parameters:
    I - the input elements type
    O - the output elements type
    All Implemented Interfaces:
    java.util.concurrent.Flow.Publisher<O>

    public class Transform<I,​O>
    extends java.lang.Object
    implements java.util.concurrent.Flow.Publisher<O>
    A Flow.Publisher that transforms elements using a Function.
    • Constructor Summary

      Constructors 
      Constructor Description
      Transform​(java.util.concurrent.Flow.Publisher<I> upstream, java.util.function.Function<I,​O> function)
      Build a new transformation publisher.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void subscribe​(java.util.concurrent.Flow.Subscriber<? super O> subscriber)  
      • Methods inherited from class java.lang.Object

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

      • Transform

        public Transform​(java.util.concurrent.Flow.Publisher<I> upstream,
                         java.util.function.Function<I,​O> function)
        Build a new transformation publisher.
        Parameters:
        upstream - the upstream publisher
        function - the transformation function, must not throw exceptions, must not return null values
    • Method Detail

      • subscribe

        public void subscribe​(java.util.concurrent.Flow.Subscriber<? super O> subscriber)
        Specified by:
        subscribe in interface java.util.concurrent.Flow.Publisher<I>