Class MaybeConverter
- java.lang.Object
-
- io.smallrye.reactive.converters.rxjava2.MaybeConverter
-
- All Implemented Interfaces:
ReactiveTypeConverter<io.reactivex.Maybe>
public class MaybeConverter extends Object implements ReactiveTypeConverter<io.reactivex.Maybe>
Converter handling the RX Java 2Maybetype. toCompletionStage
ThetoCompletionStage(Maybe)method returns aCompletionStageinstance completed or failed according to theMaybeemission. If theMaybeis empty, the completion stage completes withnull. If the maybe emits a value, the completion stage completes with the value. fromCompletionStage
ThefromCompletionStage(CompletionStage)method returns aMaybeinstance completed or failed according to the passedCompletionStagecompletion. Note that if the passed future emits anullvalue, theMaybecompletes empty. If theCompletionStageis completed with a non-emptyOptional, the value is unwrapped. If theCompletionStageis completed with an emptyOptional, the returnedMaybeis completed empty. fromPublisher
ThefromPublisher(Publisher)method returns aMaybeemitting the first value of the stream. If the passedPublisheris empty, the returnedMaybeis empty. If the passed stream emits more than one value, only the first one is used, the other values are discarded. toRSPublisher
ThetoRSPublisher(Maybe)method returns a stream emitting a single value (if any) followed by the completion signal. If the passedMaybefails, the returnedPublisheralso fails. If the passedMaybeis empty, the returned stream is empty.
-
-
Constructor Summary
Constructors Constructor Description MaybeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanemitAtMostOneItem()booleanemitItems()io.reactivex.MaybefromCompletionStage(CompletionStage cs)<X> io.reactivex.MaybefromPublisher(org.reactivestreams.Publisher<X> publisher)booleansupportNullValue()<T> CompletionStage<T>toCompletionStage(io.reactivex.Maybe instance)<X> org.reactivestreams.Publisher<X>toRSPublisher(io.reactivex.Maybe instance)Class<io.reactivex.Maybe>type()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.converters.ReactiveTypeConverter
requireAtLeastOneItem
-
-
-
-
Method Detail
-
toCompletionStage
public <T> CompletionStage<T> toCompletionStage(io.reactivex.Maybe instance)
- Specified by:
toCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
fromCompletionStage
public io.reactivex.Maybe fromCompletionStage(CompletionStage cs)
- Specified by:
fromCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
toRSPublisher
public <X> org.reactivestreams.Publisher<X> toRSPublisher(io.reactivex.Maybe instance)
- Specified by:
toRSPublisherin interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
fromPublisher
public <X> io.reactivex.Maybe fromPublisher(org.reactivestreams.Publisher<X> publisher)
- Specified by:
fromPublisherin interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
type
public Class<io.reactivex.Maybe> type()
- Specified by:
typein interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
emitItems
public boolean emitItems()
- Specified by:
emitItemsin interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
emitAtMostOneItem
public boolean emitAtMostOneItem()
- Specified by:
emitAtMostOneItemin interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
supportNullValue
public boolean supportNullValue()
- Specified by:
supportNullValuein interfaceReactiveTypeConverter<io.reactivex.Maybe>
-
-