public class CollectionUtil
extends org.pfsw.util.CollectionUtil
Modifier and Type | Method and Description |
---|---|
<T> T[] |
asArray(java.util.Collection<T> coll,
java.lang.Class<T> elementType)
Returns an array which has elements of the specified element type.
|
<T> java.util.Set<T> |
asSet(T... objects)
Returns a new
HashSet initialized with the given objects. |
<T> java.util.stream.Stream<T> |
asStream(T[] array)
Returns the given array of objects as stream.
|
static CollectionUtil |
instance()
Returns the only instance this class supports (design pattern "Singleton")
|
boolean |
notAllAreNull(java.lang.Object... objects)
Returns true if at least one object in the given array is not null.
|
addAll, addAll, addAll, addAll, addAllNew, append, append, append, asEnumeration, asEnumeration, asIterator, asList, asList, asListType, asMap, asMap, contains, contains, contains, containsIdentical, convertCollectionElements, convertToList, convertToSet, copy, copy, copy, copy, copy, copyCollection, copyMap, copyPropertiesStartingWith, copyWithout, copyWithout, copyWithout, copyWithout, copyWithoutIdentical, createCollection, current, getFirstNonNull, indexOf, indexOf, indexOf, indexOfIdentical, indexOfObject, isAnyNull, isNoneNull, isNullOrEmpty, isNullOrEmpty, isNullOrEmpty, isNullOrEmpty, iterator, lastIndexOf, lastIndexOf, propertiesStartingWith, propertiesStartingWith, removeFromArray, removeNull, reverse, reverseCopy, splitToStringPair, toArray, toArray, toList
public static CollectionUtil instance()
public <T> T[] asArray(java.util.Collection<T> coll, java.lang.Class<T> elementType)
coll
- The collection of objects to be put into the result arrayelementType
- The type of the array elementsjava.lang.ArrayStoreException
- if any element in the collection is not of the same type as the element typepublic <T> java.util.stream.Stream<T> asStream(T[] array)
public <T> java.util.Set<T> asSet(T... objects)
HashSet
initialized with the given objects.public boolean notAllAreNull(java.lang.Object... objects)