reactor-kotlin-extensions / reactor.kotlin.extra.math / reactor.core.publisher.Flux / max

max

fun <T : Comparable<T>> Flux<T>.max(): Mono<T>

Extension to find the highest value in a Flux of Comparable values and return it as a Mono of T.

Author
Simon Baslé

Since
3.1.1

fun <T> Flux<T>.max(comp: Comparator<T>): Mono<T>

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.

Parameters

comp - The Comparator to use

Author
Simon Baslé

Since
3.1.1

fun <T> Flux<T>.max(comp: (T, T) -> Int): Mono<T>

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.

Parameters

comp - The comparison function to use (similar to a Comparator)

Author
Simon Baslé

Since
3.1.1