Klasse PairFlux<LeftT,RightT>
java.lang.Object
de.kamillionlabs.hateoflux.utility.pair.PairFlux<LeftT,RightT>
- Typparameter:
LeftT- the type of the left element in the pairRightT- the type of the right element in the pair
Wraps a
Flux of Pair objects, providing convenient factory methods to create reactive streams of
pairs.- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <LeftT,RightT>
PairFlux<LeftT, RightT> empty()Creates an emptyPairFlux.static <LeftT> PairFlux.Builder<LeftT> from(reactor.core.publisher.Flux<LeftT> flux) Initiates building aPairFluxby providing the firstFlux.static <LeftT,RightT>
PairFlux<LeftT, RightT> fromIterable(Iterable<Pair<LeftT, RightT>> iterable) static <LeftT,RightT>
PairFlux<LeftT, RightT> static <LeftT,RightT>
PairFlux<LeftT, RightT> zipWith(reactor.core.publisher.Flux<LeftT> flux, Function<LeftT, reactor.core.publisher.Mono<RightT>> mapper)
-
Methodendetails
-
empty
Creates an emptyPairFlux.- Typparameter:
LeftT- the type of the left element in the pairRightT- the type of the right element in the pair- Gibt zurück:
- a new empty
PairFluxinstance
-
of
-
fromIterable
-
zipWith
public static <LeftT,RightT> PairFlux<LeftT,RightT> zipWith(reactor.core.publisher.Flux<LeftT> flux, Function<LeftT, reactor.core.publisher.Mono<RightT>> mapper) Zips aFluxwith a correspondingMonoto create aPairFlux.Usage example:
Flux<Book> books = getBooksOnTopic("coding"); // given getAuthorByBookTitle() returns Mono< Author> PairFlux<Book, Author> pairFlux = PairFlux.zipWith(books, book -> getAuthorByBookTitle(book.getTitle()));- Typparameter:
LeftT- the type of the left element in the pairRightT- the type of the right element in the pair- Parameter:
flux- theFluxemitting the first elements of the pairmapper- a function that maps each element to aMonoemitting the corresponding second element- Gibt zurück:
- a new
PairFluxinstance emitting zipped pairs of elements
-
from
Initiates building aPairFluxby providing the firstFlux. Should be used withPairFlux.Builder.with(java.util.function.Function<LeftT, reactor.core.publisher.Mono<RightT>>).Usage example:
Flux<Book> books = getBooksOnTopic("coding"); // given getAuthorByBookTitle() returns Mono< Author> PairFlux<Book, Author> pairFlux = PairFlux.from(books) .with(book -> getAuthorByBookTitle(book.getTitle()));- Typparameter:
LeftT- the type of the left element in the pair- Parameter:
flux- theFluxemitting the first elements of the pair- Gibt zurück:
- a
PairFlux.Builderto continue building thePairFlux
-