Klasse MultiRightPairFlux<LeftT,RightT>

java.lang.Object
de.kamillionlabs.hateoflux.utility.pair.MultiRightPairFlux<LeftT,RightT>
Typparameter:
LeftT - the type of the left element in the pair
RightT - the type of the right elements in the pair

public class MultiRightPairFlux<LeftT,RightT> extends Object
Wraps a Flux of MultiRightPair objects, providing convenient factory methods to create reactive streams of pairs.
Siehe auch:
  • Methodendetails

    • empty

      public static <LeftT, RightT> MultiRightPairFlux<LeftT,RightT> empty()
      Creates an empty MultiRightPair.
      Typparameter:
      LeftT - the type of the left element in the pair
      RightT - the type of the right element in the pair
      Gibt zurück:
      a new empty MultiRightPair instance
    • of

      public static <LeftT, RightT> MultiRightPairFlux<LeftT,RightT> of(reactor.core.publisher.Flux<MultiRightPair<LeftT,RightT>> flux)
      Creates a MultiRightPairFlux from an existing Flux of MultiRightPair objects.
      Typparameter:
      LeftT - the type of the left element in the pair
      RightT - the type of the right elements in the pair
      Parameter:
      flux - the Flux emitting MultiRightPair objects
      Gibt zurück:
      a new PairFlux instance wrapping the provided Flux
    • fromIterable

      public static <LeftT, RightT> MultiRightPairFlux<LeftT,RightT> fromIterable(Iterable<MultiRightPair<LeftT,RightT>> iterable)
      Creates a MultiRightPairFlux from an Iterable of MultiRightPair objects (e.g. from a MultiRightPairList).
      Typparameter:
      LeftT - the type of the left element in the pair
      RightT - the type of the right elements in the pair
      Parameter:
      iterable - the Iterable containing MultiRightPair objects
      Gibt zurück:
      a new MultiRightPairFlux emitting the pairs from the provided Iterable
    • zipWith

      public static <LeftT, RightT> MultiRightPairFlux<LeftT,RightT> zipWith(reactor.core.publisher.Flux<LeftT> leftFlux, Function<LeftT,reactor.core.publisher.Flux<RightT>> rightMapper)
      Zips a Flux of left elements with a Flux of right elements into a MultiRightPairFlux.

      Usage example:

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

      public static <LeftT> MultiRightPairFlux.Builder<LeftT> from(reactor.core.publisher.Flux<LeftT> flux)
      Initiates building a MultiRightPairFlux by providing the first Flux. Should be used with MultiRightPairFlux.Builder.with(java.util.function.Function<LeftT, reactor.core.publisher.Flux<RightT>>).

      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:
      LeftT - the type of the left element in the pair
      Parameter:
      flux - the Flux emitting the left elements
      Gibt zurück:
      a MultiRightPairFlux.Builder to continue building the MultiRightPairFlux