Klasse PairFlux.Builder<LeftT>

java.lang.Object
de.kamillionlabs.hateoflux.utility.pair.PairFlux.Builder<LeftT>
Typparameter:
LeftT - the type of the left element in the pair
Umschließende Klasse:
PairFlux<LeftT,RightT>

public static class PairFlux.Builder<LeftT> extends Object
Builder class for PairFlux.
  • Methodendetails

    • with

      public <RightT> PairFlux<LeftT,RightT> with(Function<LeftT,reactor.core.publisher.Mono<RightT>> mapper)
      Specifies how to map each element to the right element of the pair asynchronously.

      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:
      RightT - the type of the right element in the pair
      Parameter:
      mapper - a function that maps each element to a Mono emitting the right element
      Gibt zurück:
      a new PairFlux instance emitting paired elements