Package org.apache.juneau.reflect
Class AnnotationList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<AnnotationInfo<?>>
,Collection<AnnotationInfo<?>>
,List<AnnotationInfo<?>>
,RandomAccess
An ordered list of annotations and the classes/methods/packages they were found on.
See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
AnnotationListforEach
(Class<A> type, Predicate<AnnotationInfo<A>> filter, Consumer<AnnotationInfo<A>> action) Performs an action on all matching annotations in this list.<A extends Annotation>
AnnotationListforEach
(Predicate<AnnotationInfo<?>> filter, Consumer<AnnotationInfo<?>> action) Performs an action on all matching annotations in this list.<T> AnnotationList
forEachValue
(Class<T> type, String name, Predicate<T> filter, Consumer<T> action) Performs an action on the specified matching values from all annotations in this list.sort()
Sort the annotations in this list based on rank.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
AnnotationList
public AnnotationList()
-
-
Method Details
-
sort
Sort the annotations in this list based on rank.- Returns:
- This object.
-
forEachValue
public <T> AnnotationList forEachValue(Class<T> type, String name, Predicate<T> filter, Consumer<T> action) Performs an action on the specified matching values from all annotations in this list.- Type Parameters:
T
- The annotation value type.- Parameters:
type
- The annotation value type.name
- The annotation value name.filter
- A predicate to apply to the value to determine if action should be performed. Can benull .action
- An action to perform on the value.- Returns:
- This object.
-
forEach
public <A extends Annotation> AnnotationList forEach(Class<A> type, Predicate<AnnotationInfo<A>> filter, Consumer<AnnotationInfo<A>> action) Performs an action on all matching annotations in this list.- Type Parameters:
A
- The annotation type.- Parameters:
type
- The annotation type.filter
- A predicate to apply to the entries to determine if action should be performed. Can benull .action
- An action to perform on the entry.- Returns:
- This object.
-
forEach
public <A extends Annotation> AnnotationList forEach(Predicate<AnnotationInfo<?>> filter, Consumer<AnnotationInfo<?>> action) Performs an action on all matching annotations in this list.- Type Parameters:
A
- The annotation type.- Parameters:
filter
- A predicate to apply to the entries to determine if action should be performed. Can benull .action
- An action to perform on the entry.- Returns:
- This object.
-