Package uk.gov.gchq.gaffer.commonutil
Class CollectionUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.CollectionUtil
-
public final class CollectionUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
anyMissing(Collection collection, Object... objects)
static boolean
containsAny(Collection collection, Object... objects)
static <T> boolean
distinct(Collection<T> collection)
Determine whether all of the items in the givenCollection
are unique.static Iterable[]
toIterableArray(Collection<? extends Iterable> collection)
static <K,V>
Map<Class<? extends K>,V>toMapWithClassKeys(Map<String,V> mapAsStrings)
static <K,V>
voidtoMapWithClassKeys(Map<String,V> mapAsStrings, Map<Class<? extends K>,V> map)
static <K,V>
Map<String,V>toMapWithStringKeys(Map<Class<? extends K>,V> map)
static <K,V>
voidtoMapWithStringKeys(Map<Class<? extends K>,V> map, Map<String,V> mapAsStrings)
static <T> TreeSet<T>
treeSet(T... items)
-
-
-
Method Detail
-
toIterableArray
public static Iterable[] toIterableArray(Collection<? extends Iterable> collection)
-
treeSet
public static <T> TreeSet<T> treeSet(T... items)
-
toMapWithClassKeys
public static <K,V> void toMapWithClassKeys(Map<String,V> mapAsStrings, Map<Class<? extends K>,V> map) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
toMapWithClassKeys
public static <K,V> Map<Class<? extends K>,V> toMapWithClassKeys(Map<String,V> mapAsStrings) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
toMapWithStringKeys
public static <K,V> void toMapWithStringKeys(Map<Class<? extends K>,V> map, Map<String,V> mapAsStrings)
-
toMapWithStringKeys
public static <K,V> Map<String,V> toMapWithStringKeys(Map<Class<? extends K>,V> map)
-
containsAny
public static boolean containsAny(Collection collection, Object... objects)
-
anyMissing
public static boolean anyMissing(Collection collection, Object... objects)
-
distinct
public static <T> boolean distinct(Collection<T> collection)
Determine whether all of the items in the givenCollection
are unique.- Type Parameters:
T
- the type of object contained in the collection- Parameters:
collection
- the collection to check- Returns:
true
if all the items in the Collection are unique (as determined byObject.equals(Object)
, otherwisefalse
-
-