Class ObservableFirstStageObserver<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- io.reactivex.rxjava3.internal.jdk8.ObservableStageObserver<T>
-
- io.reactivex.rxjava3.internal.jdk8.ObservableFirstStageObserver<T>
-
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
Observer<T>
,java.util.concurrent.CompletionStage<T>
,java.util.concurrent.Future<T>
public final class ObservableFirstStageObserver<T> extends ObservableStageObserver<T>
Signals the first element of the source via the underlying CompletableFuture, signals the a default item if the upstream is empty or signalsNoSuchElementException
.- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) T
defaultItem
(package private) boolean
hasDefault
-
Fields inherited from class io.reactivex.rxjava3.internal.jdk8.ObservableStageObserver
upstream, value
-
-
Constructor Summary
Constructors Constructor Description ObservableFirstStageObserver(boolean hasDefault, T defaultItem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onComplete()
Notifies theObserver
that theObservable
has finished sending push-based notifications.void
onNext(T t)
Provides theObserver
with a new item to observe.-
Methods inherited from class io.reactivex.rxjava3.internal.jdk8.ObservableStageObserver
cancel, clear, complete, completeExceptionally, disposeUpstream, onError, onSubscribe
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Field Detail
-
hasDefault
final boolean hasDefault
-
defaultItem
final T defaultItem
-
-
Constructor Detail
-
ObservableFirstStageObserver
public ObservableFirstStageObserver(boolean hasDefault, T defaultItem)
-
-
Method Detail
-
onNext
public void onNext(T t)
Description copied from interface:Observer
Provides theObserver
with a new item to observe.The
Observable
may call this method 0 or more times.The
Observable
will not call this method again after it calls eitherObserver.onComplete()
orObserver.onError(java.lang.Throwable)
.- Parameters:
t
- the item emitted by the Observable
-
onComplete
public void onComplete()
Description copied from interface:Observer
Notifies theObserver
that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsObserver.onError(java.lang.Throwable)
.
-
-