Class MultiConvert<T>

java.lang.Object
io.smallrye.mutiny.groups.MultiConvert<T>
Type Parameters:
T - the type of item emitted by the upstream.

public class MultiConvert<T> extends Object
Converts the upstream into another reactive type.
  • Constructor Details

    • MultiConvert

      public MultiConvert(Multi<T> upstream)
  • Method Details

    • with

      public <R> R with(Function<Multi<T>,R> converter)
      Transforms this Multi into a type using the provided converter.
      Type Parameters:
      R - the type produced by the converter
      Parameters:
      converter - the converter function
      Returns:
      an instance of R
      Throws:
      RuntimeException - if the conversion fails.
    • toPublisher

      @CheckReturnValue public Flow.Publisher<T> toPublisher()
      Converts the Multi into a Flow.Publisher.

      Basically, this method returns the Multi as it is, as Multi implements Flow.Publisher.

      Returns:
      the publisher