Class MappingSubscriber<T,​U>

  • All Implemented Interfaces:
    org.reactivestreams.Subscriber<T>

    public class MappingSubscriber<T,​U>
    extends Object
    implements org.reactivestreams.Subscriber<T>
    Maps a subscriber of one type to another type. If an exception is thrown by the mapping function itself, the error will be propagated to the downstream subscriber as if it had come from the publisher and then the subscription will be implicitly cancelled and no further events from the publisher will be passed along.
    • Method Detail

      • create

        public static <T,​U> MappingSubscriber<T,​U> create​(org.reactivestreams.Subscriber<? super U> subscriber,
                                                                      Function<T,​U> mapFunction)
      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription subscription)
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<T>
      • onError

        public void onError​(Throwable throwable)
        Specified by:
        onError in interface org.reactivestreams.Subscriber<T>
      • onComplete

        public void onComplete()
        Specified by:
        onComplete in interface org.reactivestreams.Subscriber<T>
      • onNext

        public void onNext​(T t)
        Specified by:
        onNext in interface org.reactivestreams.Subscriber<T>