public class PluginDefaultGroovyMethods
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
asBoolean(java.util.Optional<?> optional)
Coerce an Optional instance to a boolean value.
|
static java.util.stream.Stream<java.lang.Boolean> |
stream(boolean[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Byte> |
stream(byte[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Character> |
stream(char[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Double> |
stream(double[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Float> |
stream(float[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Integer> |
stream(int[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Long> |
stream(long[] self)
Returns a sequential
Stream with the specified array as its
source. |
static java.util.stream.Stream<java.lang.Short> |
stream(short[] self)
Returns a sequential
Stream with the specified array as its
source. |
static <T> java.util.stream.Stream<T> |
stream(T[] self)
Returns a sequential
Stream with the specified array as its
source. |
static <T> java.util.List<T> |
toList(java.util.stream.BaseStream<T,? extends java.util.stream.BaseStream> stream)
Accumulates the elements of stream into a new List.
|
static <T> java.util.List<T> |
toList(java.util.stream.Stream<T> stream)
Accumulates the elements of stream into a new List.
|
static <T> java.util.Set<T> |
toSet(java.util.stream.BaseStream<T,? extends java.util.stream.BaseStream> stream)
Accumulates the elements of stream into a new Set.
|
static <T> java.util.Set<T> |
toSet(java.util.stream.Stream<T> stream)
Accumulates the elements of stream into a new Set.
|
public static boolean asBoolean(java.util.Optional<?> optional)
optional
- the Optionaltrue
if a value is present, otherwise false
public static <T> java.util.List<T> toList(java.util.stream.Stream<T> stream)
T
- the type of elementstream
- the Streamjava.util.List
instancepublic static <T> java.util.Set<T> toSet(java.util.stream.Stream<T> stream)
T
- the type of elementstream
- the Streamjava.util.Set
instancepublic static <T> java.util.List<T> toList(java.util.stream.BaseStream<T,? extends java.util.stream.BaseStream> stream)
T
- the type of elementstream
- the java.util.stream.BaseStream
java.util.List
instancepublic static <T> java.util.Set<T> toSet(java.util.stream.BaseStream<T,? extends java.util.stream.BaseStream> stream)
T
- the type of elementstream
- the java.util.stream.BaseStream
java.util.Set
instancepublic static <T> java.util.stream.Stream<T> stream(T[] self)
Stream
with the specified array as its
source.T
- The type of the array elementsself
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Integer> stream(int[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Long> stream(long[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Double> stream(double[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Character> stream(char[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Byte> stream(byte[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Short> stream(short[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Boolean> stream(boolean[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the arraypublic static java.util.stream.Stream<java.lang.Float> stream(float[] self)
Stream
with the specified array as its
source.self
- The array, assumed to be unmodified during useStream
for the array