Package org.jmxtrans.agent.util.collect
Class Iterables2
java.lang.Object
org.jmxtrans.agent.util.collect.Iterables2
public class Iterables2 extends Object
Inspired by
com.google.common.collect.Iterables.- Author:
- Cyrille Le Clerc
-
Method Summary
-
Method Details
-
get
@Nullable public static <T> T get(@Nonnull Iterable<T> iterable, @Nonnegative int position) throws NullPointerException, IndexOutOfBoundsExceptionReturns the element at the specified position in an iterable.- Parameters:
iterable- the iterable to search intoposition- the position of the entry to return- Returns:
- the entry at the given
locationin the giveniterablethrows - Throws:
IndexOutOfBoundsException- if givenpositionis negative or greater than or equal to the size of giveniterableNullPointerException
-