Class VavrCollectors

java.lang.Object
org.jdbi.v3.vavr.VavrCollectors

public class VavrCollectors extends Object
  • Method Details

    • toOption

      public static <T> Collector<T,?,io.vavr.control.Option<T>> toOption()
      Returns a Collector that accumulates 0 or 1 input elements into an Option<T>. The returned collector will throw IllegalStateException whenever 2 or more elements are present in a stream. Null elements are mapped to Option.none().
      Type Parameters:
      T - the collected type
      Returns:
      a Collector which collects 0 or 1 input elements into an Option<T>.