Class MaybeCount<T>

java.lang.Object
io.reactivex.rxjava3.core.Single<Long>
io.reactivex.rxjava3.internal.operators.maybe.MaybeCount<T>
Type Parameters:
T - the source value type
All Implemented Interfaces:
SingleSource<Long>, HasUpstreamMaybeSource<T>

public final class MaybeCount<T> extends Single<Long> implements HasUpstreamMaybeSource<T>
Signals 1L if the source signalled an item or 0L if the source is empty.
  • Field Details

  • Constructor Details

  • Method Details

    • source

      public MaybeSource<T> source()
      Description copied from interface: HasUpstreamMaybeSource
      Returns the upstream source of this Maybe.

      Allows discovering the chain of observables.

      Specified by:
      source in interface HasUpstreamMaybeSource<T>
      Returns:
      the source MaybeSource
    • subscribeActual

      protected void subscribeActual(SingleObserver<? super Long> observer)
      Description copied from class: Single
      Implement this method in subclasses to handle the incoming SingleObservers.

      There is no need to call any of the plugin hooks on the current Single instance or the SingleObserver; all hooks and basic safeguards have been applied by Single.subscribe(SingleObserver) before this method gets called.

      Specified by:
      subscribeActual in class Single<Long>
      Parameters:
      observer - the SingleObserver to handle, not null