public class CollectionUtils extends Object
- This contains helper functions to get information from a Collection.
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <V> V |
getFromCollectionByIndex(Collection<V> collection,
int index)
The n-th element in the iterator, where n is the provided index.
|
public static <V> V getFromCollectionByIndex(Collection<V> collection, int index)
collection
- The collection from which the element should be retrieved. (NonNull)index
- The position of the object you want to retrieve from the collection.NoSuchElementException
- when the provided index is not within the bounds for the iterator.