Package org.fest.util
Class Iterables
java.lang.Object
org.fest.util.Iterables
Utility methods related to
Iterables.- Author:
- Yvonne Wang, Alex Ruiz, Joel Costigliola
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisNullOrEmpty(Iterable<?> iterable) Indicates whether the givenIterableisnullor empty.static <T> List<T>nonNullElementsIn(Iterable<T> i) Returns all the non-nullelements in the givenIterable.static intReturns the size of the givenIterable.
-
Method Details
-
isNullOrEmpty
Indicates whether the givenIterableisnullor empty.- Parameters:
iterable- the givenIterableto check.- Returns:
trueif the givenIterableisnullor empty, otherwisefalse.
-
sizeOf
Returns the size of the givenIterable.- Parameters:
iterable- theIterableto get size.- Returns:
- the size of the given
Iterable. - Throws:
NullPointerException- if givenIterableis null.
-
nonNullElementsIn
Returns all the non-nullelements in the givenIterable.- Type Parameters:
T- the type of elements of theIterable.- Parameters:
i- the givenIterable.- Returns:
- all the non-
nullelements in the givenIterable. An empty list is returned if the givenIterableisnull. - Since:
- 1.1.3
-