Class MaybeMapOptional<T,​R>

  • Type Parameters:
    T - the upstream success value type
    R - the result value type
    All Implemented Interfaces:
    MaybeSource<R>

    public final class MaybeMapOptional<T,​R>
    extends Maybe<R>
    Maps the success value to an Optional and emits its non-empty value or completes.
    Since:
    3.0.0
    • Field Detail

      • source

        final Maybe<T> source
      • mapper

        final Function<? super T,​java.util.Optional<? extends R>> mapper
    • Constructor Detail

      • MaybeMapOptional

        public MaybeMapOptional​(Maybe<T> source,
                                Function<? super T,​java.util.Optional<? extends R>> mapper)
    • Method Detail

      • subscribeActual

        protected void subscribeActual​(MaybeObserver<? super R> observer)
        Description copied from class: Maybe
        Implement this method in subclasses to handle the incoming MaybeObservers.

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

        Specified by:
        subscribeActual in class Maybe<R>
        Parameters:
        observer - the MaybeObserver to handle, not null