Class AnnotationDescriptor<A extends Annotation>

java.lang.Object
org.hibernate.validator.internal.util.annotation.AnnotationDescriptor<A>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConstraintAnnotationDescriptor

public class AnnotationDescriptor<A extends Annotation> extends Object implements Serializable
Encapsulates the data you need to create an annotation. In particular, it stores the type of an Annotation instance and the values of its elements. The "elements" we're talking about are the annotation attributes, not its targets (the term "element" is used ambiguously in Java's annotations documentation).
Author:
Paolo Perrotta, Davide Marchignoli, Hardy Ferentschik, Gunnar Morling, Guillaume Smet
See Also:
  • Constructor Details

    • AnnotationDescriptor

      public AnnotationDescriptor(A annotation)
    • AnnotationDescriptor

      public AnnotationDescriptor(AnnotationDescriptor<A> descriptor)
  • Method Details

    • getType

      public Class<A> getType()
    • getAttributes

      public Map<String,Object> getAttributes()
    • getMandatoryAttribute

      public <T> T getMandatoryAttribute(String attributeName, Class<T> attributeType)
    • getAttribute

      public <T> T getAttribute(String attributeName, Class<T> attributeType)
    • getAttribute

      public Object getAttribute(String attributeName)
    • getAnnotation

      public A getAnnotation()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Calculates the hash code of this annotation descriptor as described in Annotation.hashCode().
      Overrides:
      hashCode in class Object
      Returns:
      The hash code of this descriptor.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object