Defines new Groovy methods which appear on normal JDK 8 classes inside the Groovy environment.
| Type Params | Return Type | Name and description |
|---|---|---|
|
static boolean |
asBoolean(Optional<?> optional)Coerce an Optional instance to a boolean value. |
<T> |
static List<T> |
toList(Stream<T> stream)Accumulates the elements of stream into a new List. |
<T> |
static Set<T> |
toSet(Stream<T> stream)Accumulates the elements of stream into a new Set. |
Coerce an Optional instance to a boolean value.
optional - the Optionaltrue if a value is present, otherwise falseAccumulates the elements of stream into a new List.
stream - the Streamjava.util.List instance