Klasse MultiRightPairFlux.Builder<LeftT>

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

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

    • with

      public <RightT> MultiRightPairFlux<LeftT,RightT> with(Function<LeftT,reactor.core.publisher.Flux<RightT>> rightMapper)
      Specifies how to map each left element to its corresponding right elements asynchronously.

      Usage example:

       Flux<Author> japaneseAuthors = getAuthorsFrom("Japan");
      
       // given getBooksOfAuthor() returns Flux<Book>
       MultiRightPairFlux<Author, Book> authorsWithTheirBooks =
               MultiRightPairFlux.from(japaneseAuthors)
                       .with(author -> getBooksOfAuthor(author.getName()));
       
      Typparameter:
      RightT - the type of the right elements in the pair
      Parameter:
      rightMapper - a function that maps each left element to a Flux emitting right elements
      Gibt zurück:
      a new MultiRightPairFlux instance emitting paired elements