Class SingleConverter
- java.lang.Object
-
- io.smallrye.reactive.converters.rxjava2.SingleConverter
-
- All Implemented Interfaces:
ReactiveTypeConverter<io.reactivex.Single>
public class SingleConverter extends Object implements ReactiveTypeConverter<io.reactivex.Single>
Converter handling the RX Java 2Singletype. toCompletionStage
ThetoCompletionStage(Single)method returns aCompletionStageinstance completed or failed according to the single emission. fromCompletionStage
ThefromCompletionStage(CompletionStage)method returns aSingleinstance completed or failed according to the passedCompletionStagecompletion. Note that if the future emits anullvalue, theSingleemits a failure. fromPublisher
ThefromPublisher(Publisher)method returns aSingleemitting the first value of the stream. If the passedPublisheris empty, the returnedSinglefails. If the passed stream emits more than one value, only the first one is used, the other values are discarded. toRSPublisher
ThetoRSPublisher(Single)method returns a stream emitting a single value followed by the completion signal. If the passedSinglefails, the returned stream also fails.
-
-
Constructor Summary
Constructors Constructor Description SingleConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanemitAtMostOneItem()booleanemitItems()<X> io.reactivex.Single<X>fromCompletionStage(CompletionStage<X> cs)<X> io.reactivex.SinglefromPublisher(org.reactivestreams.Publisher<X> publisher)booleanrequireAtLeastOneItem()booleansupportNullValue()<T> CompletionStage<T>toCompletionStage(io.reactivex.Single instance)<X> org.reactivestreams.Publisher<X>toRSPublisher(io.reactivex.Single instance)Class<io.reactivex.Single>type()
-
-
-
Method Detail
-
toCompletionStage
public <T> CompletionStage<T> toCompletionStage(io.reactivex.Single instance)
- Specified by:
toCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Single>
-
toRSPublisher
public <X> org.reactivestreams.Publisher<X> toRSPublisher(io.reactivex.Single instance)
- Specified by:
toRSPublisherin interfaceReactiveTypeConverter<io.reactivex.Single>
-
fromCompletionStage
public <X> io.reactivex.Single<X> fromCompletionStage(CompletionStage<X> cs)
- Specified by:
fromCompletionStagein interfaceReactiveTypeConverter<io.reactivex.Single>
-
fromPublisher
public <X> io.reactivex.Single fromPublisher(org.reactivestreams.Publisher<X> publisher)
- Specified by:
fromPublisherin interfaceReactiveTypeConverter<io.reactivex.Single>
-
type
public Class<io.reactivex.Single> type()
- Specified by:
typein interfaceReactiveTypeConverter<io.reactivex.Single>
-
emitItems
public boolean emitItems()
- Specified by:
emitItemsin interfaceReactiveTypeConverter<io.reactivex.Single>
-
emitAtMostOneItem
public boolean emitAtMostOneItem()
- Specified by:
emitAtMostOneItemin interfaceReactiveTypeConverter<io.reactivex.Single>
-
supportNullValue
public boolean supportNullValue()
- Specified by:
supportNullValuein interfaceReactiveTypeConverter<io.reactivex.Single>
-
requireAtLeastOneItem
public boolean requireAtLeastOneItem()
- Specified by:
requireAtLeastOneItemin interfaceReactiveTypeConverter<io.reactivex.Single>
-
-