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 anAnnotationinstance 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotationDescriptor.Builder<S extends Annotation>
-
Constructor Summary
Constructors Constructor Description AnnotationDescriptor(A annotation)AnnotationDescriptor(AnnotationDescriptor<A> descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)AgetAnnotation()ObjectgetAttribute(String attributeName)<T> TgetAttribute(String attributeName, Class<T> attributeType)Map<String,Object>getAttributes()<T> TgetMandatoryAttribute(String attributeName, Class<T> attributeType)Class<A>getType()inthashCode()Calculates the hash code of this annotation descriptor as described inAnnotation.hashCode().StringtoString()
-
-
-
Constructor Detail
-
AnnotationDescriptor
public AnnotationDescriptor(A annotation)
-
AnnotationDescriptor
public AnnotationDescriptor(AnnotationDescriptor<A> descriptor)
-
-
Method Detail
-
getMandatoryAttribute
public <T> T getMandatoryAttribute(String attributeName, Class<T> attributeType)
-
getAnnotation
public A getAnnotation()
-
hashCode
public int hashCode()
Calculates the hash code of this annotation descriptor as described inAnnotation.hashCode().- Overrides:
hashCodein classObject- Returns:
- The hash code of this descriptor.
- See Also:
Annotation.hashCode()
-
-