Package org.marketcetera.util.misc
Class CollectionUtils
- java.lang.Object
-
- org.marketcetera.util.misc.CollectionUtils
-
public final class CollectionUtils extends Object
Utilities for collections.- Since:
- 0.6.0
- Version:
- $Id: CollectionUtils.java 17760 2018-11-14 14:54:11Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCollectionUtils()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> EgetLastNonNull(List<E> l)Returns the last non-null element in the given list; or, if there is no non-null element, it returns null.static int[]toArray(List<Integer> l)Returns the non-null integers in the given list as an array.
-
-
-
Method Detail
-
getLastNonNull
public static <E> E getLastNonNull(List<E> l)
Returns the last non-null element in the given list; or, if there is no non-null element, it returns null.- Type Parameters:
E- the element- Parameters:
l- The list. It may be null, in which case null is returned.- Returns:
- The element.
-
-