Class MaybeConverter

  • All Implemented Interfaces:
    ReactiveTypeConverter<io.reactivex.Maybe>

    public class MaybeConverter
    extends Object
    implements ReactiveTypeConverter<io.reactivex.Maybe>
    Converter handling the RX Java 2 Maybe type. toCompletionStage
    The toCompletionStage(Maybe) method returns a CompletionStage instance completed or failed according to the Maybe emission. If the Maybe is empty, the completion stage completes with null. If the maybe emits a value, the completion stage completes with the value. fromCompletionStage
    The fromCompletionStage(CompletionStage) method returns a Maybe instance completed or failed according to the passed CompletionStage completion. Note that if the passed future emits a null value, the Maybe completes empty. If the CompletionStage is completed with a non-empty Optional, the value is unwrapped. If the CompletionStage is completed with an empty Optional, the returned Maybe is completed empty. fromPublisher
    The fromPublisher(Publisher) method returns a Maybe emitting the first value of the stream. If the passed Publisher is empty, the returned Maybe is empty. If the passed stream emits more than one value, only the first one is used, the other values are discarded. toRSPublisher
    The toRSPublisher(Maybe) method returns a stream emitting a single value (if any) followed by the completion signal. If the passed Maybe fails, the returned Publisher also fails. If the passed Maybe is empty, the returned stream is empty.