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
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation>
Implements theAnnotation.annotationType()
method for child classes.boolean
int
hashCode()
protected void
This 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:
annotationType
in interfaceAnnotation
- Returns:
- This class.
-
hashCode
- Specified by:
hashCode
in interfaceAnnotation
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceAnnotation
- Overrides:
equals
in 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:
toString
in interfaceAnnotation
- Overrides:
toString
in classObject
-