Class ReactiveAdapterRegistryHelper
java.lang.Object
org.springframework.graphql.execution.ReactiveAdapterRegistryHelper
- Since:
- 1.3.1
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> reactor.core.publisher.Flux<T> toFluxFromCollection(@Nullable Object result) Return aFluxfor the given result Object that represents a logical collection of values.static <T> reactor.core.publisher.Mono<T> Return aMonofor the given Object by delegating totoMonoIfReactive(java.lang.Object), and then applyingMono.justOrEmpty(java.util.Optional<? extends T>)if necessary.static @Nullable ObjecttoMonoIfReactive(@Nullable Object result) Return aMonofor the given result Object if it can be adapted to aPublisherviaReactiveAdapterRegistry.static @Nullable ObjecttoMonoOrFluxIfReactive(@Nullable Object result) Adapt the given result Object toMonoorFluxif it can be adapted to a single or multi-valuePublisherrespectively viaReactiveAdapterRegistry.static reactor.core.publisher.Flux<?> toSubscriptionFlux(@Nullable Object result) Return aFluxfor the given result Object, adapting to aPublisherviaReactiveAdapterRegistryor wrapping it asFluxif necessary.
- 
Constructor Details- 
ReactiveAdapterRegistryHelperpublic ReactiveAdapterRegistryHelper()
 
- 
- 
Method Details- 
toMonoReturn aMonofor the given Object by delegating totoMonoIfReactive(java.lang.Object), and then applyingMono.justOrEmpty(java.util.Optional<? extends T>)if necessary.- Type Parameters:
- T- the type of element in the Mono to cast to
- Parameters:
- result- the result Object to adapt
- Returns:
- a Monothat represents the result
 
- 
toMonoIfReactiveReturn aMonofor the given result Object if it can be adapted to aPublisherviaReactiveAdapterRegistry. Multivalued publishers are collected to a List.- Parameters:
- result- the result Object to adapt
- Returns:
- the same instance or a Monoif the object is known toReactiveAdapterRegistry
 
- 
toMonoOrFluxIfReactiveAdapt the given result Object toMonoorFluxif it can be adapted to a single or multi-valuePublisherrespectively viaReactiveAdapterRegistry.- Parameters:
- result- the result Object to adapt
- Returns:
- the same instance, a Mono, or aFlux
 
- 
toSubscriptionFluxReturn aFluxfor the given result Object, adapting to aPublisherviaReactiveAdapterRegistryor wrapping it asFluxif necessary.- Parameters:
- result- the result Object to adapt
- Returns:
- a Flux, possibly empty if the result isnull
 
- 
toFluxFromCollectionReturn aFluxfor the given result Object that represents a logical collection of values. The Object must be aCollectionor a publisher of aCollection, which is flattened withFlux.fromIterable(Iterable), or a multi-value publisher.- Type Parameters:
- T- the type of element in the collection to cast to
- Parameters:
- result- the result Object to adapt
- Returns:
- a Fluxthat represents the collection
 
 
-