Class PluginDefaultGroovyMethods
java.lang.Object
org.codehaus.groovy.vmplugin.v8.PluginDefaultGroovyMethods
Defines new Groovy methods which appear on normal JDK 8
classes inside the Groovy environment.
- Since:
- 2.5.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCoerce an Optional instance to a boolean value.stream(boolean[] self) Returns a sequentialStreamwith the specified array as its source.stream(byte[] self) Returns a sequentialStreamwith the specified array as its source.stream(char[] self) Returns a sequentialStreamwith the specified array as its source.stream(double[] self) Returns a sequentialStreamwith the specified array as its source.stream(float[] self) Returns a sequentialStreamwith the specified array as its source.stream(int[] self) Returns a sequentialStreamwith the specified array as its source.stream(long[] self) Returns a sequentialStreamwith the specified array as its source.stream(short[] self) Returns a sequentialStreamwith the specified array as its source.static <T> Stream<T> stream(T[] self) Returns a sequentialStreamwith the specified array as its source.static <T> List<T> toList(BaseStream<T, ? extends BaseStream> stream) Accumulates the elements of stream into a new List.static <T> List<T> Accumulates the elements of stream into a new List.static <T> Set<T> toSet(BaseStream<T, ? extends BaseStream> stream) Accumulates the elements of stream into a new Set.static <T> Set<T> Accumulates the elements of stream into a new Set.
-
Method Details
-
asBoolean
Coerce an Optional instance to a boolean value.- Parameters:
optional- the Optional- Returns:
trueif a value is present, otherwisefalse
-
toList
-
toSet
-
toList
Accumulates the elements of stream into a new List.- Type Parameters:
T- the type of element- Parameters:
stream- thejava.util.stream.BaseStream- Returns:
- a new
java.util.Listinstance
-
toSet
Accumulates the elements of stream into a new Set.- Type Parameters:
T- the type of element- Parameters:
stream- thejava.util.stream.BaseStream- Returns:
- a new
java.util.Setinstance
-
stream
-
stream
-
stream
-
stream
-
stream
-
stream
-
stream
-
stream
-
stream
-