hu.akarnokd.rxjava2.basetypes

## Class PerhapsProcessor<T>

- java.lang.Object
- - hu.akarnokd.rxjava2.basetypes.Perhaps<T>
  - - hu.akarnokd.rxjava2.basetypes.PerhapsProcessor<T>

Type Parameters:
  `T` - the input and output value type

All Implemented Interfaces:
  org.reactivestreams.Processor<T,T>, org.reactivestreams.Publisher<T>, org.reactivestreams.Subscriber<T>

    public final class PerhapsProcessor<T>
    extends Perhaps<T>
    implements org.reactivestreams.Processor<T,T>

A Processor based on the Perhaps type that emits an onNext+onComplete, only onComplete or an onError.

Calling the onNext multiple times has no effect.

Since:
  0.14.0

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static <T> PerhapsProcessor<T>` `create()` Creates a fresh PerhapsProcessor instance.
`java.lang.Throwable` `getThrowable()` Returns the received onError Throwable if hasThrowable() is true, null otherwise.
`T` `getValue()` Returns the received onNext value if hasValue() is true, null otherwise.
`boolean` `hasComplete()` Returns true if this PerhapsProcessor completed without any value.
`boolean` `hasSubscribers()` Returns true if this Processor has Subscribers.
`boolean` `hasThrowable()` Returns true if this PerhapsProcessor received an onError Throwable.
`boolean` `hasValue()` Returns true if this PerhapsProcessor received an onNext value.
`void` `onComplete()`
`void` `onError(java.lang.Throwable t)`
`void` `onNext(T t)`
`void` `onSubscribe(org.reactivestreams.Subscription s)`
`protected void` `subscribeActual(org.reactivestreams.Subscriber<? super T> s)` Implement this method to react to a Subscriber subscribing to this Perhaps.

### Methods inherited from class hu.akarnokd.rxjava2.basetypes.Perhaps

`amb, ambArray, ambWith, andThen, andThen, blockingGet, blockingGet, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, cache, compose, concat, concat, concat, concatArray, concatArrayDelayError, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatWith, create, defaultIfEmpty, defer, delay, delay, delay, delaySubscription, delaySubscription, delaySubscription, doAfterNext, doAfterTerminate, doFinally, doOnCancel, doOnComplete, doOnError, doOnNext, doOnRequest, doOnSubscribe, empty, error, error, filter, flatMap, flatMap, flatMapPublisher, fromAction, fromCallable, fromCompletable, fromFuture, fromFuture, fromMaybe, 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, onErrorComplete, onErrorResumeNext, onErrorResumeWith, onErrorReturnItem, repeat, repeat, repeat, repeatWhen, retry, retry, retry, retryWhen, setOnAssemblyHandler, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, takeUntil, test, test, test, test, timeout, timeout, timeout, timeout, timeout, timeout, timer, timer, to, toFlowable, toFuture, toMaybe, toObservable, unsubscribeOn, using, using, zip, zipArray, zipWith`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.reactivestreams.Publisher

`subscribe`

### Method Detail

#### create

    public static <T> PerhapsProcessor<T> create()

Creates a fresh PerhapsProcessor instance.

Type Parameters:
  `T` - the input and output value type
Returns:
  the new PerhapsProcessor instance

#### subscribeActual

    protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s)

Description copied from class: `Perhaps`
Implement this method to react to a Subscriber subscribing to this Perhaps.

Specified by:
  `subscribeActual` in class `Perhaps<T>`
Parameters:
  `s` - the downstream Subscriber, never null

#### onSubscribe

    public void onSubscribe(org.reactivestreams.Subscription s)

Specified by:
  `onSubscribe` in interface `org.reactivestreams.Subscriber<T>`

#### onNext

    public void onNext(T t)

Specified by:
  `onNext` in interface `org.reactivestreams.Subscriber<T>`

#### onError

    public void onError(java.lang.Throwable t)

Specified by:
  `onError` in interface `org.reactivestreams.Subscriber<T>`

#### onComplete

    public void onComplete()

Specified by:
  `onComplete` in interface `org.reactivestreams.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 PerhapsProcessor received an onNext value.

Returns:
  true if this PerhapsProcessor 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 PerhapsProcessor received an onError Throwable.

Returns:
  true if this PerhapsProcessor 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

#### hasComplete

    public boolean hasComplete()

Returns true if this PerhapsProcessor completed without any value.

Returns:
  true if this PerhapsProcessor completed without any value