public class VavrCollectors extends Object
| Constructor and Description |
|---|
VavrCollectors() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Collector<T,?,io.vavr.control.Option<T>> |
toOption()
Returns a
Collector that accumulates 0 or 1 input elements into an Option<T>. |
public static <T> Collector<T,?,io.vavr.control.Option<T>> toOption()
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().T - the collected typeCollector which collects 0 or 1 input elements into an Option<T>.Copyright © 2018. All rights reserved.