se.unlogic.standardutils.collections
Class CollectionUtils
java.lang.Object
se.unlogic.standardutils.collections.CollectionUtils
public class CollectionUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionUtils
public CollectionUtils()
getGenericList
public static <T> List<T> getGenericList(Class<T> clazz,
int size)
getGenericList
public static <T> List<T> getGenericList(Class<T> clazz)
getGenericSingletonList
public static <T> List<T> getGenericSingletonList(T bean)
isEmpty
public static boolean isEmpty(Collection<?> collection)
conjunction
public static <T> List<T> conjunction(Collection<T> c1,
Collection<T> c2)
exclusiveDisjunction
public static <T> Collection<T> exclusiveDisjunction(Collection<T> c1,
Collection<T> c2)
- Returns the part of a disjunction of two collections that comes from the first collection (in argument order)
- Type Parameters:
T
- - Parameters:
c1
- Collection of objectsc2
- Collection of objects
- Returns:
- all elements that exists exclusively in c1
getList
public static <T> List<T> getList(T... objects)
removeNullValues
public static void removeNullValues(List<?> list)
getSize
public static int getSize(Collection<?> collection)
- Parameters:
list
-
- Returns:
- the size of the collection or 0 if the collection is null
Copyright © 2011. All Rights Reserved.