Package org.apache.juneau.annotation
Class AnnotationImpl
java.lang.Object
org.apache.juneau.annotation.AnnotationImpl
- All Implemented Interfaces:
Annotation
- Direct Known Subclasses:
TargetedAnnotationImpl
A concrete implementation of an annotation.
Follows the standard Java conventions for equality and hashcode calculation for annotations. Equivalent annotations defined programmatically and declaratively should match for equality and hashcode calculation.
For performance reasons, the hashcode is calculated one time and cached at the end of object creation.
Constructors must call the postConstruct() method after all fields have been set to trigger this calculation.
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation>Implements theAnnotation.annotationType()method for child classes.booleaninthashCode()protected voidThis method must be called at the end of initialization to calculate the hashCode one time.toMap()Returns this annotation as a map of key/value pairs.toString()
-
Constructor Details
-
AnnotationImpl
Constructor.- Parameters:
b- The builder used to instantiate the fields of this class.
-
-
Method Details
-
postConstruct
This method must be called at the end of initialization to calculate the hashCode one time. -
annotationType
Implements theAnnotation.annotationType()method for child classes.- Specified by:
annotationTypein interfaceAnnotation- Returns:
- This class.
-
hashCode
- Specified by:
hashCodein interfaceAnnotation- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceAnnotation- Overrides:
equalsin classObject
-
toMap
Returns this annotation as a map of key/value pairs.Useful for debugging.
- Returns:
- This annotation as a map of key/value pairs.
-
toString
- Specified by:
toStringin interfaceAnnotation- Overrides:
toStringin classObject
-