| Constructor and Description |
|---|
DiggOptionals() |
| Modifier and Type | Method and Description |
|---|---|
static <T,A,R> R |
collect(Optional<T> optional,
Collector<T,A,R> collector)
|
static <T> List<T> |
toList(Optional<T> optional)
Unwrap an
Optional into a zero or one element unmodifiable list. |
static <T> Stream<T> |
toStream(Optional<T>... optionals)
|
@SafeVarargs public static <T> Stream<T> toStream(Optional<T>... optionals)
T - The type of the given Optionals and returned Stream.optionals - The Optionals to convert to a Stream.Stream containing the present Optionalspublic static <T> List<T> toList(Optional<T> optional)
Optional into a zero or one element unmodifiable list.T - The type of the optional value.optional - The optional value to be wrapped in a list.Optional being present or not.public static <T,A,R> R collect(Optional<T> optional, Collector<T,A,R> collector)
T - The type of the optional value.R - The resulting container type.optional - The optional value to be wrapped in another container.collector - The collector to use for wrapping into another container.Optional being present or not.Copyright © 2016 Digipost. All rights reserved.