Class SoloProcessor<T>

  • Type Parameters:
    T - the input and output value type
    All Implemented Interfaces:
    Processor<T,​T>, Publisher<T>, Subscriber<T>

    public final class SoloProcessor<T>
    extends Solo<T>
    implements Processor<T,​T>
    A Processor based on the Solo type that emits an onNext+onComplete or an onError.

    Calling the onNext multiple times has no effect. Calling the onComplete without calling the onNext will emit a NoSuchElementException to subscribers.

    Since:
    0.13.0
    • Method Detail

      • create

        public static <T> SoloProcessor<T> create()
        Creates a fresh SoloProcessor instance.
        Type Parameters:
        T - the input and output value type
        Returns:
        the new SoloProcessor instance
      • subscribeActual

        protected void subscribeActual​(Subscriber<? super T> s)
        Description copied from class: Solo
        Implement this method to react to a Subscriber subscribing to this Solo.
        Specified by:
        subscribeActual in class Solo<T>
        Parameters:
        s - the downstream Subscriber, never null
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface Subscriber<T>
      • hasSubscribers

        public boolean hasSubscribers()
        Returns true if this Processor has Subscribers.
        Returns:
        true if this Processor has Subscribers
      • hasValue

        public boolean hasValue()
        Returns true if this SoloProcessor received an onNext value.
        Returns:
        true if this SoloProcessor received an onNext value
      • getValue

        public T getValue()
        Returns the received onNext value if hasValue() is true, null otherwise.
        Returns:
        the received onNext value if hasValue() is true, null otherwise
      • hasThrowable

        public boolean hasThrowable()
        Returns true if this SoloProcessor received an onError Throwable.
        Returns:
        true if this SoloProcessor received an onError Throwable
      • getThrowable

        public java.lang.Throwable getThrowable()
        Returns the received onError Throwable if hasThrowable() is true, null otherwise.
        Returns:
        the received onError Throwable if hasThrowable() is true, null otherwise