Class AnnotationList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<AnnotationInfo<?>>, Collection<AnnotationInfo<?>>, List<AnnotationInfo<?>>, RandomAccess

public final class AnnotationList extends ArrayList<AnnotationInfo<?>>
An ordered list of annotations and the classes/methods/packages they were found on.
See Also:
  • Constructor Details

  • Method Details

    • sort

      public AnnotationList 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 be null.
      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 be null.
      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 be null.
      action - An action to perform on the entry.
      Returns:
      This object.