hu.akarnokd.rxjava2.subjects

## Class CompletableSubject

- java.lang.Object
- - io.reactivex.Completable
  - - hu.akarnokd.rxjava2.subjects.CompletableSubject

All Implemented Interfaces:
  io.reactivex.CompletableObserver, io.reactivex.CompletableSource

    public final class CompletableSubject
    extends io.reactivex.Completable
    implements io.reactivex.CompletableObserver

Represents a hot Completable-like source and consumer of events similar to Subjects.

All methods are thread safe. Calling onComplete multiple times has no effect. Calling onError multiple times relays the Throwable to the RxJavaPlugins' error handler.

The CompletableSubject doesn't store the Disposables coming through onSubscribe but disposes them once the other onXXX methods were called (terminal state reached).

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static CompletableSubject` `create()` Creates a fresh CompletableSubject.
`java.lang.Throwable` `getThrowable()` Returns the terminal error if this CompletableSubject has been terminated with an error, null otherwise.
`boolean` `hasComplete()` Returns true if this CompletableSubject has been completed.
`boolean` `hasObservers()` Returns true if this CompletableSubject has observers.
`boolean` `hasThrowable()` Returns true if this CompletableSubject has been terminated with an error.
`void` `onComplete()`
`void` `onError(java.lang.Throwable e)`
`void` `onSubscribe(io.reactivex.disposables.Disposable d)`
`protected void` `subscribeActual(io.reactivex.CompletableObserver observer)`

### Methods inherited from class io.reactivex.Completable

`amb, ambArray, ambWith, andThen, andThen, andThen, andThen, andThen, blockingAwait, blockingAwait, blockingGet, blockingGet, complete, compose, concat, concat, concat, concatArray, concatWith, create, defer, delay, delay, delay, doAfterTerminate, doFinally, doOnComplete, doOnDispose, doOnError, doOnEvent, doOnSubscribe, doOnTerminate, error, error, fromAction, fromCallable, fromFuture, fromObservable, fromPublisher, fromRunnable, fromSingle, lift, merge, merge, merge, mergeArray, mergeArrayDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeWith, never, observeOn, onErrorComplete, onErrorComplete, onErrorResumeNext, repeat, repeat, repeatUntil, repeatWhen, retry, retry, retry, retry, retryWhen, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, test, test, timeout, timeout, timeout, timeout, timer, timer, to, toFlowable, toMaybe, toObservable, toSingle, toSingleDefault, unsafeCreate, unsubscribeOn, using, using, wrap`

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

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

### Method Detail

#### create

    public static CompletableSubject create()

Creates a fresh CompletableSubject.

Returns:
  the new CompletableSubject instance

#### onSubscribe

    public void onSubscribe(io.reactivex.disposables.Disposable d)

Specified by:
  `onSubscribe` in interface `io.reactivex.CompletableObserver`

#### onError

    public void onError(java.lang.Throwable e)

Specified by:
  `onError` in interface `io.reactivex.CompletableObserver`

#### onComplete

    public void onComplete()

Specified by:
  `onComplete` in interface `io.reactivex.CompletableObserver`

#### subscribeActual

    protected void subscribeActual(io.reactivex.CompletableObserver observer)

Specified by:
  `subscribeActual` in class `io.reactivex.Completable`

#### getThrowable

    public java.lang.Throwable getThrowable()

Returns the terminal error if this CompletableSubject has been terminated with an error, null otherwise.

Returns:
  the terminal error or null if not terminated or not with an error

#### hasThrowable

    public boolean hasThrowable()

Returns true if this CompletableSubject has been terminated with an error.

Returns:
  true if this CompletableSubject has been terminated with an error

#### hasComplete

    public boolean hasComplete()

Returns true if this CompletableSubject has been completed.

Returns:
  true if this CompletableSubject has been completed

#### hasObservers

    public boolean hasObservers()

Returns true if this CompletableSubject has observers.

Returns:
  true if this CompletableSubject has observers