@Internal public class Publishers extends java.lang.Object
Publisher instances. Designed for internal use by Micronaut and
 not as a replacement for a reactive library such as RxJava, Reactor, Akka etc.| Modifier and Type | Class and Description | 
|---|---|
static interface  | 
Publishers.MapOrSupplyEmpty<T,R>
Maps the next result or supplies an empty result. 
 | 
static interface  | 
Publishers.MicronautPublisher<T>
Marker interface for any micronaut produced publishers. 
 | 
| Constructor and Description | 
|---|
Publishers()  | 
| Modifier and Type | Method and Description | 
|---|---|
static <T> T | 
convertPublisher(java.lang.Object object,
                java.lang.Class<T> publisherType)
Attempts to convert the publisher to the given type. 
 | 
static <T> org.reactivestreams.Publisher<T> | 
empty()
A  
Publisher that completes without emitting any items. | 
static <T> org.reactivestreams.Publisher<T> | 
fromCompletableFuture(java.util.concurrent.CompletableFuture<T> future)
Build a  
Publisher from a CompletableFuture. | 
static <T> org.reactivestreams.Publisher<T> | 
fromCompletableFuture(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> futureSupplier)
Build a  
Publisher from a CompletableFuture. | 
static java.util.List<java.lang.Class<?>> | 
getKnownReactiveTypes()  | 
static boolean | 
isCompletable(java.lang.Class<?> type)
Does the given reactive type emit a single result. 
 | 
static boolean | 
isConvertibleToPublisher(java.lang.Class<?> type)
Is the given type a Publisher or convertible to a publisher. 
 | 
static boolean | 
isConvertibleToPublisher(java.lang.Object object)
Is the given object a Publisher or convertible to a publisher. 
 | 
static boolean | 
isSingle(java.lang.Class<?> type)
Does the given reactive type emit a single result. 
 | 
static <T> org.reactivestreams.Publisher<T> | 
just(T value)
A  
Publisher that emits a fixed single value. | 
static <T> org.reactivestreams.Publisher<T> | 
just(java.lang.Throwable error)
A  
Publisher that emits a fixed single value. | 
static <T,R> org.reactivestreams.Publisher<R> | 
map(org.reactivestreams.Publisher<T> publisher,
   java.util.function.Function<T,R> mapper)
Map the result from a publisher using the given mapper. 
 | 
static <T,R> org.reactivestreams.Publisher<R> | 
mapOrSupplyEmpty(org.reactivestreams.Publisher<T> publisher,
                Publishers.MapOrSupplyEmpty<T,R> mapOrSupplyEmpty)
Map the result from a publisher using the given mapper or supply empty value. 
 | 
static <T> org.reactivestreams.Publisher<T> | 
onComplete(org.reactivestreams.Publisher<T> publisher,
          java.util.function.Supplier<java.util.concurrent.CompletableFuture<java.lang.Void>> future)
Allow executing logic on completion of a Publisher. 
 | 
static void | 
registerReactiveCompletable(java.lang.Class<?> type)
Registers an additional reactive completable type. 
 | 
static void | 
registerReactiveSingle(java.lang.Class<?> type)
Registers an additional reactive single type. 
 | 
static void | 
registerReactiveType(java.lang.Class<?> type)
Registers an additional reactive type. 
 | 
static <T> org.reactivestreams.Publisher<T> | 
then(org.reactivestreams.Publisher<T> publisher,
    java.util.function.Consumer<T> consumer)
Map the result from a publisher using the given mapper. 
 | 
public static void registerReactiveType(java.lang.Class<?> type)
type - The typepublic static void registerReactiveSingle(java.lang.Class<?> type)
type - The typepublic static void registerReactiveCompletable(java.lang.Class<?> type)
type - The typepublic static java.util.List<java.lang.Class<?>> getKnownReactiveTypes()
public static <T> org.reactivestreams.Publisher<T> fromCompletableFuture(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> futureSupplier)
Publisher from a CompletableFuture.T - The type of the publisherfutureSupplier - The supplier of the CompletableFuturePublisherpublic static <T> org.reactivestreams.Publisher<T> fromCompletableFuture(java.util.concurrent.CompletableFuture<T> future)
Publisher from a CompletableFuture.T - The type of the publisherfuture - The CompletableFuturePublisherpublic static <T> org.reactivestreams.Publisher<T> just(T value)
Publisher that emits a fixed single value.T - The value typevalue - The value to emitPublisherpublic static <T> org.reactivestreams.Publisher<T> just(java.lang.Throwable error)
Publisher that emits a fixed single value.T - The value typeerror - The error to emitPublisherpublic static <T> org.reactivestreams.Publisher<T> empty()
Publisher that completes without emitting any items.T - The value typePublisherpublic static <T,R> org.reactivestreams.Publisher<R> map(org.reactivestreams.Publisher<T> publisher,
                                                         java.util.function.Function<T,R> mapper)
T - The generic typeR - The result typepublisher - The publishermapper - The mapperpublic static <T,R> org.reactivestreams.Publisher<R> mapOrSupplyEmpty(org.reactivestreams.Publisher<T> publisher,
                                                                      Publishers.MapOrSupplyEmpty<T,R> mapOrSupplyEmpty)
T - The generic typeR - The result typepublisher - The publishermapOrSupplyEmpty - The mapOrSupplyEmptypublic static <T> org.reactivestreams.Publisher<T> then(org.reactivestreams.Publisher<T> publisher,
                                                        java.util.function.Consumer<T> consumer)
T - The generic typepublisher - The publisherconsumer - The mapperpublic static <T> org.reactivestreams.Publisher<T> onComplete(org.reactivestreams.Publisher<T> publisher,
                                                              java.util.function.Supplier<java.util.concurrent.CompletableFuture<java.lang.Void>> future)
T - The generic typepublisher - The publisherfuture - The runnablepublic static boolean isConvertibleToPublisher(java.lang.Class<?> type)
type - The type to checkpublic static boolean isConvertibleToPublisher(java.lang.Object object)
object - The objectpublic static <T> T convertPublisher(java.lang.Object object,
                                     java.lang.Class<T> publisherType)
T - The generic typeobject - The object to convertpublisherType - The publisher typepublic static boolean isSingle(java.lang.Class<?> type)
type - The typepublic static boolean isCompletable(java.lang.Class<?> type)
type - The type