public interface Annotation
|Modifier and Type||Method and Description|
Returns the type of this annotation.
Determines whether or not this annotation is equivalent to the annotation passed.
Returns the hash code of this annotation.
Class<? extends Annotation> annotationType()
Classinstance representing the annotation type.
boolean equals(Object obj)
yare equal if and only if they are members of the same annotation type and all the member values of
xare equal to the corresponding member values of
yis determined (in a way similar to) using the corresponding wrapper classes. For example,
Integer.valueOf(x).equals(Integer.valueOf(y)is used for
intvalues. Note: The behavior is identical to the
==operator for all but the floating point type, so the implementation may as well use
==in these cases for performance reasons. Only for the
doubletypes the result will be slightly different:
NaNis equal to
-0.0is equal to
0.0, both of which is normally not the case.
yis determined using the corresponding
equals(x, y)helper function in
(0x7f * n.hashCode()) ^ v.hashCode()), where
nis the name of the member (as a
Integer.valueOf(v).hashCode()is used for an
vis determined using the corresponding
hashCode(v)helper function in
Stringrepresentation of this annotation. It is not strictly defined what the representation has to look like, but it usually consists of the name of the annotation, preceded by a "@". If the annotation contains field members, their names and values are also included in the result.