public class MathFluxExtensionsKt
@NotNull public static <T extends Number> reactor.core.publisher.Mono<java.lang.Long> sum(@NotNull reactor.core.publisher.Flux<T> $receiver)
@NotNull public static <T extends Number> reactor.core.publisher.Mono<java.lang.Double> sumDouble(@NotNull reactor.core.publisher.Flux<T> $receiver)
@NotNull public static <T extends Number> reactor.core.publisher.Mono<java.lang.Double> average(@NotNull reactor.core.publisher.Flux<T> $receiver)
Extension to compute the Double average of all values emitted by a Flux of Number and return it as a Mono of Double.
Note that since Double are more precise, some seemingly rounded Floats (e.g. 1.6f) may convert to Doubles with more decimals (eg. 1.600000023841858), producing sometimes unexpected averages.
@NotNull public static <T extends Comparable<? super T>> reactor.core.publisher.Mono<T> min(@NotNull reactor.core.publisher.Flux<T> $receiver)
Extension to find the lowest value in a Flux of Comparable values and return it as a Mono of T.
@NotNull public static <T extends Comparable<? super T>> reactor.core.publisher.Mono<T> max(@NotNull reactor.core.publisher.Flux<T> $receiver)
Extension to find the highest value in a Flux of Comparable values and return it as a Mono of T.
@NotNull
public static <T> reactor.core.publisher.Mono<java.lang.Long> sum(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends java.lang.Number> mapper)
@NotNull
public static <T> reactor.core.publisher.Mono<java.lang.Double> sumDouble(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends java.lang.Number> mapper)
Extension to map arbitrary values in a Flux to Numbers and return the sum of these Numbers as a Mono of Double, thus avoiding rounding down to zero decimal places.
Note that since Double are more precise than Float, some seemingly rounded Floats (e.g. 1.6f) may convert to Doubles with more decimals (eg. 1.600000023841858), producing sometimes unexpected results.
@NotNull
public static <T> reactor.core.publisher.Mono<java.lang.Double> average(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends java.lang.Number> mapper)
Extension to map arbitrary values in a Flux to Numbers and return the average of these Numbers as a Mono of Double.
Note that since Double are more precise than Float, some seemingly rounded Floats (e.g. 1.6f) may convert to Doubles with more decimals (eg. 1.600000023841858), producing sometimes unexpected results.
@NotNull
public static <T> reactor.core.publisher.Mono<T> min(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
java.util.Comparator<T> comp)
Extension to find the lowest value in a Flux and return it as a Mono. The lowest value is defined by comparisons made using a provided Comparator.
comp - The Comparator to use@NotNull
public static <T> reactor.core.publisher.Mono<T> min(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> comp)
Extension to find the lowest value in a Flux and return it as a Mono. The lowest value is defined by comparisons made using a provided function that behaves like a Comparator.
comp - The comparison function to use (similar to a Comparator)@NotNull
public static <T> reactor.core.publisher.Mono<T> max(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
java.util.Comparator<T> comp)
Extension to find the highest value in a Flux and return it as a Mono. The highest value is defined by comparisons made using a provided Comparator.
comp - The Comparator to use@NotNull
public static <T> reactor.core.publisher.Mono<T> max(@NotNull
reactor.core.publisher.Flux<T> $receiver,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> comp)
Extension to find the highest value in a Flux and return it as a Mono. The highest value is defined by comparisons made using a provided function that behaves like a Comparator.
comp - The comparison function to use (similar to a Comparator)