Package hu.akarnokd.rxjava3.basetypes
Class SoloProcessor<T>
- java.lang.Object
-
- hu.akarnokd.rxjava3.basetypes.Solo<T>
-
- hu.akarnokd.rxjava3.basetypes.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> SoloProcessor<T>create()Creates a fresh SoloProcessor instance.java.lang.ThrowablegetThrowable()Returns the received onError Throwable if hasThrowable() is true, null otherwise.TgetValue()Returns the received onNext value if hasValue() is true, null otherwise.booleanhasSubscribers()Returns true if this Processor has Subscribers.booleanhasThrowable()Returns true if this SoloProcessor received an onError Throwable.booleanhasValue()Returns true if this SoloProcessor received an onNext value.voidonComplete()voidonError(java.lang.Throwable t)voidonNext(T t)voidonSubscribe(Subscription s)protected voidsubscribeActual(Subscriber<? super T> s)Implement this method to react to a Subscriber subscribing to this Solo.-
Methods inherited from class hu.akarnokd.rxjava3.basetypes.Solo
amb, ambArray, ambWith, andThen, andThen, blockingGet, blockingGet, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, cache, compose, concat, concat, concat, concatArray, concatArrayDelayError, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatWith, create, defer, delay, delay, delay, delaySubscription, delaySubscription, delaySubscription, doAfterNext, doAfterTerminate, doFinally, doOnCancel, doOnComplete, doOnError, doOnNext, doOnRequest, doOnSubscribe, error, error, filter, flatMap, flatMap, flatMapPublisher, fromCallable, fromFuture, fromFuture, fromPublisher, fromSingle, getOnAssemblyHandler, hide, ignoreElement, just, lift, map, mapError, merge, merge, merge, merge, mergeArray, mergeArray, mergeArrayDelayError, mergeArrayDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeWith, never, observeOn, onAssembly, onErrorResumeNext, onErrorResumeWith, onErrorReturnItem, repeat, repeat, repeat, repeatWhen, retry, retry, retry, retryWhen, setOnAssemblyHandler, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, takeUntil, test, test, test, test, timeout, timeout, timeout, timeout, timeout, timeout, timer, timer, to, toFlowable, toFuture, toObservable, toSingle, unsubscribeOn, using, using, zip, zipArray, zipWith
-
-
-
-
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:SoloImplement this method to react to a Subscriber subscribing to this Solo.- Specified by:
subscribeActualin classSolo<T>- Parameters:
s- the downstream Subscriber, never null
-
onSubscribe
public void onSubscribe(Subscription s)
- Specified by:
onSubscribein interfaceSubscriber<T>
-
onNext
public void onNext(T t)
- Specified by:
onNextin interfaceSubscriber<T>
-
onError
public void onError(java.lang.Throwable t)
- Specified by:
onErrorin interfaceSubscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceSubscriber<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
-
-