Class MaybeCallbackObserver<T>

java.lang.Object
java.util.concurrent.atomic.AtomicReference<Disposable>
io.reactivex.rxjava3.internal.operators.maybe.MaybeCallbackObserver<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
MaybeObserver<T>, Disposable, LambdaConsumerIntrospection, Serializable

public final class MaybeCallbackObserver<T> extends AtomicReference<Disposable> implements MaybeObserver<T>, Disposable, LambdaConsumerIntrospection
MaybeObserver that delegates the onSuccess, onError and onComplete method calls to callbacks.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the resource, the operation should be idempotent.
      Specified by:
      dispose in interface Disposable
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Returns true if this resource has been disposed.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if this resource has been disposed
    • onSubscribe

      public void onSubscribe(Disposable d)
      Description copied from interface: MaybeObserver
      Provides the MaybeObserver with the means of cancelling (disposing) the connection (channel) with the Maybe in both synchronous (from within onSubscribe(Disposable) itself) and asynchronous manner.
      Specified by:
      onSubscribe in interface MaybeObserver<T>
      Parameters:
      d - the Disposable instance whose Disposable.dispose() can be called anytime to cancel the connection
    • onSuccess

      public void onSuccess(T value)
      Description copied from interface: MaybeObserver
      Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.

      The Maybe will not call this method if it calls MaybeObserver.onError(java.lang.Throwable).

      Specified by:
      onSuccess in interface MaybeObserver<T>
      Parameters:
      value - the item emitted by the Maybe
    • onError

      public void onError(Throwable e)
      Description copied from interface: MaybeObserver
      Notifies the MaybeObserver that the Maybe has experienced an error condition.

      If the Maybe calls this method, it will not thereafter call MaybeObserver.onSuccess(T).

      Specified by:
      onError in interface MaybeObserver<T>
      Parameters:
      e - the exception encountered by the Maybe
    • onComplete

      public void onComplete()
      Description copied from interface: MaybeObserver
      Called once the deferred computation completes normally.
      Specified by:
      onComplete in interface MaybeObserver<T>
    • hasCustomOnError

      public boolean hasCustomOnError()
      Description copied from interface: LambdaConsumerIntrospection
      Returns true or false if a custom onError consumer has been provided.
      Specified by:
      hasCustomOnError in interface LambdaConsumerIntrospection
      Returns:
      true if a custom onError consumer implementation was supplied. Returns false if the implementation is missing an error consumer and thus using a throwing default implementation.