Class ConsumerSingleObserver<T>

java.lang.Object
java.util.concurrent.atomic.AtomicReference<Disposable>
io.reactivex.rxjava3.internal.observers.ConsumerSingleObserver<T>
All Implemented Interfaces:
SingleObserver<T>, Disposable, LambdaConsumerIntrospection, Serializable

public final class ConsumerSingleObserver<T> extends AtomicReference<Disposable> implements SingleObserver<T>, Disposable, LambdaConsumerIntrospection
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • onError

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

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

      Specified by:
      onError in interface SingleObserver<T>
      Parameters:
      e - the exception encountered by the Single
    • onSubscribe

      public void onSubscribe(Disposable d)
      Description copied from interface: SingleObserver
      Provides the SingleObserver with the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from within onSubscribe(Disposable) itself) and asynchronous manner.
      Specified by:
      onSubscribe in interface SingleObserver<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: SingleObserver
      Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.

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

      Specified by:
      onSuccess in interface SingleObserver<T>
      Parameters:
      value - the item emitted by the Single
    • 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
    • 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.