public interface Annotation
Modifier and Type | Method and Description |
---|---|
Class<? extends Annotation> |
annotationType()
Returns the type of this annotation.
|
boolean |
equals(Object obj)
Determines whether or not this annotation is equivalent to the annotation
passed.
|
int |
hashCode()
Returns the hash code of this annotation.
|
String |
toString()
Returns a
String representation of this annotation. |
Class<? extends Annotation> annotationType()
Class
instance representing the annotation type.boolean equals(Object obj)
x
and y
are equal if and only if
they are members of the same annotation type and all the member
values of x
are equal to the corresponding member values
of y
.
x
and y
is determined (in a way similar to) using the corresponding
wrapper classes. For example,
Integer.valueOf(x).equals(Integer.valueOf(y)
is used for
int
values. 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 float
and double
types the result will be slightly different: NaN
is equal
to NaN
, and -0.0
is equal to 0.0
, both of
which is normally not the case.
x
and y
is determined using the corresponding equals(x, y)
helper function in Arrays
.
equals()
method.
equals
in class Object
obj
- The object to compare to.true
if obj
is equal to this annotation,
false
otherwise.Object.hashCode()
int hashCode()
(0x7f * n.hashCode()) ^ v.hashCode())
, where n
is the
name of the member (as a String
) and v
its value.
Integer.valueOf(v).hashCode()
is used for an int
value
v
.
v
is determined
using the corresponding hashCode(v)
helper function in
Arrays
.
hashCode
method.
hashCode
in class Object
Object.equals(java.lang.Object)
String toString()
String
representation 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.