public final class OperationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <IN extends OUT,OUT> |
cast()
Casts an item from one type to another
|
static Mono<byte[]> |
collectByteArray(Flux<byte[]> bytes)
Operation to collect a
Flux<byte[]> into a contiguous single byte array, delivered as a single element of a Mono<byte[]>. |
static <T,U> Function<Mono<T>,Mono<T>> |
thenKeep(Function<T,Mono<U>> thenFunction)
Produces a Mono transformer that preserves the type of the source
Mono<IN>. |
public static <IN extends OUT,OUT> Function<IN,OUT> cast()
IN - the source typeOUT - the target typepublic static Mono<byte[]> collectByteArray(Flux<byte[]> bytes)
Flux<byte[]> into a contiguous single byte array, delivered as a single element of a Mono<byte[]>.bytes - a Flux of 0 or more byte arrayspublic static <T,U> Function<Mono<T>,Mono<T>> thenKeep(Function<T,Mono<U>> thenFunction)
Mono<IN>.
The Mono produced expects a single element from the source, passes this to the function (as in .then) and requests an element from the resulting Mono<OUT>. When successful, the
result (if any) is discarded and the input value is signalled.
Summary: does a .then on the new Mono but keeps the input to pass on unchanged.
Usage: Can be used inline thus: .as(thenKeep(in -> funcOf(in)))
T - the source element typeU - the element type of the Mono produced by thenFunctionthenFunction - from source input element to some Mono<OUT>Copyright © 2017 Pivotal Software, Inc.. All rights reserved.