Class FlowableConverter
- java.lang.Object
-
- io.smallrye.reactive.converters.rxjava2.FlowableConverter
-
- All Implemented Interfaces:
ReactiveTypeConverter<io.reactivex.Flowable>
public class FlowableConverter extends Object implements ReactiveTypeConverter<io.reactivex.Flowable>
Converter handling the RX Java 2Flowabletype. toCompletionStage
ThetoCompletionStage(Flowable)method returns aCompletionStageinstance completed or failed according to the stream emissions. The returnedCompletionStageis redeemed with the first emitted value,nullif the stream is empty. If the stream emits multiple values, the first one is used, and theCompletionStageis completed with the first emitted item. Other items and potential error are ignored. If the stream fails before emitting a first item, theCompletionStageis completed with the failure. fromCompletionStage
ThefromCompletionStage(CompletionStage)method returns aFlowableinstance completed or failed according to the passedCompletionStagecompletion. Note that if the future emits anullvalue, theFlowablefails. If the future completes with a value, the observable emits the value and then completes. If the future completes with a failure, the stream emits the failure. fromPublisher
ThefromPublisher(Publisher)method returns aFlowableemitting the same items, failure and completion as the passedPublisher. If the passedPublisheris empty, the returnedFlowableis also empty. This operation is a pass-through for back-pressure and its behavior is determined by the back-pressure behavior of the passed publisher. This operation usesFlowable.fromPublisher(Publisher). If the passedPublisheris already aFlowable, the instance is used directly. toRSPublisher
ThetoRSPublisher(Flowable)method returns aPublisheremitting the same events as the sourceFlowable. This operation is a pass-through for back-pressure and its behavior is determined by the back-pressure behavior of the passedFlowable. This operation returns the passedFlowabledirectly.
-
-
Constructor Summary
Constructors Constructor Description FlowableConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanemitAtMostOneItem()booleanemitItems()<X> io.reactivex.FlowablefromCompletionStage(CompletionStage<X> cs)io.reactivex.FlowablefromPublisher(org.reactivestreams.Publisher publisher)booleansupportNullValue()<T> CompletionStage<T>toCompletionStage(io.reactivex.Flowable instance)<T> org.reactivestreams.Publisher<T>toRSPublisher(io.reactivex.Flowable instance)Class<io.reactivex.Flowable>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
-
toRSPublisher
public <T> org.reactivestreams.Publisher<T> toRSPublisher(io.reactivex.Flowable instance)
- Specified by:
toRSPublisherin interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
fromPublisher
public io.reactivex.Flowable fromPublisher(org.reactivestreams.Publisher publisher)
- Specified by:
fromPublisherin interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
toCompletionStage
public <T> CompletionStage<T> toCompletionStage(io.reactivex.Flowable instance)
- Specified by:
toCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
fromCompletionStage
public <X> io.reactivex.Flowable fromCompletionStage(CompletionStage<X> cs)
- Specified by:
fromCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
type
public Class<io.reactivex.Flowable> type()
- Specified by:
typein interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
emitItems
public boolean emitItems()
- Specified by:
emitItemsin interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
emitAtMostOneItem
public boolean emitAtMostOneItem()
- Specified by:
emitAtMostOneItemin interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
supportNullValue
public boolean supportNullValue()
- Specified by:
supportNullValuein interfaceReactiveTypeConverter<io.reactivex.Flowable>
-
-