Class Annotations

java.lang.Object
com.fasterxml.classmate.Annotations
All Implemented Interfaces:
Serializable, Iterable<Annotation>

public class Annotations extends Object implements Serializable, Iterable<Annotation>
Container class used for storing set of annotations resolved for types (classes) as members (methods, fields, constructors).
See Also:
  • Field Details

  • Constructor Details

    • Annotations

      public Annotations()
  • Method Details

    • add

      public void add(Annotation override)
      Method for adding specified annotation, overriding existing value for the annotation type.
    • addAll

      public void addAll(Annotations overrides)
      Method for adding all annotations from specified set, as overrides to annotations this set has
    • addAsDefault

      public void addAsDefault(Annotation defValue)
      Method for adding specified annotation if and only if no value exists for the annotation type.
    • iterator

      public Iterator<Annotation> iterator()
      Specified by:
      iterator in interface Iterable<Annotation>
    • size

      public int size()
    • get

      public <A extends Annotation> A get(Class<A> cls)
    • asArray

      public Annotation[] asArray()
      Since:
      1.1.1
    • asList

      public List<Annotation> asList()
      Since:
      1.1.1
    • toString

      public String toString()
      Overrides:
      toString in class Object