Package de.xima.fc.utils
Class IterableUtils
- java.lang.Object
-
- de.xima.fc.utils.IterableUtils
-
@Deprecated public final class IterableUtils extends Object
Deprecated.UseXIterableUtils
.Additional utilities forIterable
s not found in other libraries.- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IterableUtils.Indexed<T>
Deprecated.
-
Constructor Summary
Constructors Constructor Description IterableUtils()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> T
firstOrNull(Iterable<T> iterable)
Deprecated.static <T> Iterable<IterableUtils.Indexed<T>>
withIndex(Iterable<T> iterable)
Deprecated.
-
-
-
Method Detail
-
firstOrNull
@Deprecated public static <T> T firstOrNull(Iterable<T> iterable)
Deprecated.Similar to thefirst
method from Apache Commons, but returnsnull
instead of throwing if the iterable is empty.- Type Parameters:
T
- Type of the items in the iterable.- Parameters:
iterable
- Iterable to process.- Returns:
- The first item in the iterable, or
null
if either the iterable isnull
or it contains no items.
-
withIndex
@Deprecated public static <T> Iterable<IterableUtils.Indexed<T>> withIndex(Iterable<T> iterable)
Deprecated.Wraps an iterable and adds the index to each element.- Type Parameters:
T
- Type of the elements in the iterable.- Parameters:
iterable
- Iterable to wrap.- Returns:
- An iterable that iterates over the same elements, but with a 0-based index added to each element.
-
-