|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.common.CollectionUtils
public abstract class CollectionUtils
Utility methods for operations on collections.
Method Summary | ||
---|---|---|
static
|
filterByType(Iterable<?> collection,
Class<T> expectedType)
Returns a list of objects of expectedType contained in the given collection . |
|
static
|
getAnnotation(Annotation[] annotations,
Class<T> annotationType)
Finds an annotation of given annotationType from the given annotations . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> List<T> filterByType(Iterable<?> collection, Class<T> expectedType)
expectedType
contained in the given collection
. Any
objects in the collection that are not assignable to the given expectedType
are filtered out.
The order of the items in the list is the same as the order they were provided by the collection. The given
collection
remains unchanged by this method.
If the given collection is null, en empty list is returned.
T
- The type items in the returned List must be assignable to.collection
- An iterable (e.g. Collection) containing the unfiltered items.expectedType
- The type items in the returned List must be assignable to.
expectedType
. May be empty, but never null
.public static <T> T getAnnotation(Annotation[] annotations, Class<T> annotationType)
annotationType
from the given annotations
. If
annotations
contains multiple annotations of the given type, the first one is returned. If none
is found, this method returns null
.
T
- The type of annotation to search forannotations
- The annotations to search inannotationType
- The type of annotation to search for
null
if no such annotation is present
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |