public class Iterables
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
all(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate) |
static <T> boolean |
any(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate) |
static <T> java.lang.Iterable<T> |
from(java.util.Iterator<T> iterator) |
static <T> java.lang.Iterable<T> |
from(java.lang.Object container)
Converts a container of some kind into a possibly once-only
Iterable. |
static <T> java.lang.Iterable<T> |
from(java.util.stream.Stream<T> stream) |
static <T> java.lang.Iterable<T> |
from(T... objects) |
static <T> boolean |
none(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate) |
static <T> void |
removeAll(java.lang.Iterable<T> iterable) |
public static <T> java.lang.Iterable<T> from(java.util.Iterator<T> iterator)
@SafeVarargs public static <T> java.lang.Iterable<T> from(T... objects)
public static <T> java.lang.Iterable<T> from(java.util.stream.Stream<T> stream)
public static <T> java.lang.Iterable<T> from(java.lang.Object container)
Iterable.container - the non-null container to turn into an Iterable, can be one of Iterable, Iterator, Stream or Array.java.lang.ClassCastException - if the container is not one of Iterable, Iterator, Stream or
Arraypublic static <T> boolean all(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate)
Sequence satisfy the given predicate, false otherwise.public static <T> boolean none(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate)
Sequence satisfy the given predicate, false otherwise.public static <T> boolean any(java.lang.Iterable<T> iterable,
java.util.function.Predicate<? super T> predicate)
Sequence satisfies the given predicate, false otherwise.public static <T> void removeAll(java.lang.Iterable<T> iterable)