Package org.jdbi.v3.vavr
Class VavrCollectors
- java.lang.Object
-
- org.jdbi.v3.vavr.VavrCollectors
-
public class VavrCollectors extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateVavrCollectors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.stream.Collector<T,?,io.vavr.control.Option<T>>toOption()Returns aCollectorthat accumulates 0 or 1 input elements into anOption<T>.
-
-
-
Method Detail
-
toOption
public static <T> java.util.stream.Collector<T,?,io.vavr.control.Option<T>> toOption()
Returns aCollectorthat accumulates 0 or 1 input elements into anOption<T>. The returned collector will throwIllegalStateExceptionwhenever 2 or more elements are present in a stream. Null elements are mapped toOption.none().- Type Parameters:
T- the collected type- Returns:
- a
Collectorwhich collects 0 or 1 input elements into anOption<T>.
-
-