| Modifier and Type | Method and Description |
|---|---|
static <E> Iterable<E> |
emptyToNull(Iterable<E> iterable)
Returns the given iterable if it is non-empty,
null otherwise. |
static boolean |
isNullOrEmpty(Iterable<?> iterable)
Checks whether the given iterable is
null or empty. |
static <E> Iterable<E> |
nullToEmpty(Iterable<E> iterable)
Returns the given iterable if it is non-empty, empty iterable otherwise.
|
static <E> Stream<E> |
parallelStream(Iterable<E> iterable)
Returns a parallel
Stream over the elements of the given iterable. |
static <E> Stream<E> |
stream(Iterable<E> iterable)
Returns a sequential
Stream over the elements of the given iterable. |
static <E> List<E> |
toList(Iterable<E> elements)
Returns the given iterable converted to a
List. |
static <E> NavigableSet<E> |
toNavigableSet(Iterable<E> elements)
Returns the given iterable converted to a
NavigableSet. |
static <E> Set<E> |
toSet(Iterable<E> elements)
Returns the given iterable converted to a
Set. |
public static <E> Iterable<E> emptyToNull(Iterable<E> iterable)
null otherwise.public static boolean isNullOrEmpty(Iterable<?> iterable)
null or empty.public static <E> Iterable<E> nullToEmpty(Iterable<E> iterable)
public static <E> Stream<E> parallelStream(Iterable<E> iterable)
Stream over the elements of the given iterable.IllegalArgumentException - if iterable is nullpublic static <E> Stream<E> stream(Iterable<E> iterable)
Stream over the elements of the given iterable.IllegalArgumentException - if iterable is nullpublic static <E> List<E> toList(Iterable<E> elements)
List.IllegalArgumentException - if elements are nullpublic static <E> NavigableSet<E> toNavigableSet(Iterable<E> elements)
NavigableSet.IllegalArgumentException - if elements are nullpublic static <E> Set<E> toSet(Iterable<E> elements)
Set.IllegalArgumentException - if elements are null