Package org.codehaus.groovy.vmplugin.v8
Class PluginDefaultGroovyMethods
- java.lang.Object
- 
- org.codehaus.groovy.vmplugin.v8.PluginDefaultGroovyMethods
 
- 
 public class PluginDefaultGroovyMethods extends java.lang.ObjectDefines new Groovy methods which appear on normal JDK 8 classes inside the Groovy environment.- Since:
- 2.5.0
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanasBoolean(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 sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Byte>stream(byte[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Character>stream(char[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Double>stream(double[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Float>stream(float[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Integer>stream(int[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Long>stream(long[] self)Returns a sequentialStreamwith the specified array as its source.static java.util.stream.Stream<java.lang.Short>stream(short[] self)Returns a sequentialStreamwith the specified array as its source.static <T> java.util.stream.Stream<T>stream(T[] self)Returns a sequentialStreamwith 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.
 
- 
- 
- 
Method Detail- 
asBooleanpublic static boolean asBoolean(java.util.Optional<?> optional) Coerce an Optional instance to a boolean value.- Parameters:
- optional- the Optional
- Returns:
- trueif a value is present, otherwise- false
 
 - 
toListpublic static <T> java.util.List<T> toList(java.util.stream.Stream<T> stream) Accumulates the elements of stream into a new List.- Type Parameters:
- T- the type of element
- Parameters:
- stream- the Stream
- Returns:
- a new java.util.Listinstance
 
 - 
toSetpublic static <T> java.util.Set<T> toSet(java.util.stream.Stream<T> stream) Accumulates the elements of stream into a new Set.- Type Parameters:
- T- the type of element
- Parameters:
- stream- the Stream
- Returns:
- a new java.util.Setinstance
 
 - 
toListpublic 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.- Type Parameters:
- T- the type of element
- Parameters:
- stream- the- java.util.stream.BaseStream
- Returns:
- a new java.util.Listinstance
 
 - 
toSetpublic 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.- Type Parameters:
- T- the type of element
- Parameters:
- stream- the- java.util.stream.BaseStream
- Returns:
- a new java.util.Setinstance
 
 - 
streampublic static <T> java.util.stream.Stream<T> stream(T[] self) Returns a sequentialStreamwith the specified array as its source.- Type Parameters:
- T- The type of the array elements
- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Integer> stream(int[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Long> stream(long[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Double> stream(double[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Character> stream(char[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Byte> stream(byte[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Short> stream(short[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Boolean> stream(boolean[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 - 
streampublic static java.util.stream.Stream<java.lang.Float> stream(float[] self) Returns a sequentialStreamwith the specified array as its source.- Parameters:
- self- The array, assumed to be unmodified during use
- Returns:
- a Streamfor the array
 
 
- 
 
-