Moving modules around so the runtime is under one master pom and can be built without building other modules that are in the repository
2 * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
26 package java.lang.annotation;
29 * The common interface extended by all annotation types. Note that an
30 * interface that manually extends this one does <i>not</i> define
31 * an annotation type. Also note that this interface does not itself
32 * define an annotation type.
34 * More information about annotation types can be found in section 9.6 of
35 * <cite>The Java™ Language Specification</cite>.
40 public interface Annotation {
42 * Returns true if the specified object represents an annotation
43 * that is logically equivalent to this one. In other words,
44 * returns true if the specified object is an instance of the same
45 * annotation type as this instance, all of whose members are equal
46 * to the corresponding member of this annotation, as defined below:
48 * <li>Two corresponding primitive typed members whose values are
49 * <tt>x</tt> and <tt>y</tt> are considered equal if <tt>x == y</tt>,
50 * unless their type is <tt>float</tt> or <tt>double</tt>.
52 * <li>Two corresponding <tt>float</tt> members whose values
53 * are <tt>x</tt> and <tt>y</tt> are considered equal if
54 * <tt>Float.valueOf(x).equals(Float.valueOf(y))</tt>.
55 * (Unlike the <tt>==</tt> operator, NaN is considered equal
56 * to itself, and <tt>0.0f</tt> unequal to <tt>-0.0f</tt>.)
58 * <li>Two corresponding <tt>double</tt> members whose values
59 * are <tt>x</tt> and <tt>y</tt> are considered equal if
60 * <tt>Double.valueOf(x).equals(Double.valueOf(y))</tt>.
61 * (Unlike the <tt>==</tt> operator, NaN is considered equal
62 * to itself, and <tt>0.0</tt> unequal to <tt>-0.0</tt>.)
64 * <li>Two corresponding <tt>String</tt>, <tt>Class</tt>, enum, or
65 * annotation typed members whose values are <tt>x</tt> and <tt>y</tt>
66 * are considered equal if <tt>x.equals(y)</tt>. (Note that this
67 * definition is recursive for annotation typed members.)
69 * <li>Two corresponding array typed members <tt>x</tt> and <tt>y</tt>
70 * are considered equal if <tt>Arrays.equals(x, y)</tt>, for the
71 * appropriate overloading of {@link java.util.Arrays#equals}.
74 * @return true if the specified object represents an annotation
75 * that is logically equivalent to this one, otherwise false
77 boolean equals(Object obj);
80 * Returns the hash code of this annotation, as defined below:
82 * <p>The hash code of an annotation is the sum of the hash codes
83 * of its members (including those with default values), as defined
86 * The hash code of an annotation member is (127 times the hash code
87 * of the member-name as computed by {@link String#hashCode()}) XOR
88 * the hash code of the member-value, as defined below:
90 * <p>The hash code of a member-value depends on its type:
92 * <li>The hash code of a primitive value <tt><i>v</i></tt> is equal to
93 * <tt><i>WrapperType</i>.valueOf(<i>v</i>).hashCode()</tt>, where
94 * <tt><i>WrapperType</i></tt> is the wrapper type corresponding
95 * to the primitive type of <tt><i>v</i></tt> ({@link Byte},
96 * {@link Character}, {@link Double}, {@link Float}, {@link Integer},
97 * {@link Long}, {@link Short}, or {@link Boolean}).
99 * <li>The hash code of a string, enum, class, or annotation member-value
100 I <tt><i>v</i></tt> is computed as by calling
101 * <tt><i>v</i>.hashCode()</tt>. (In the case of annotation
102 * member values, this is a recursive definition.)
104 * <li>The hash code of an array member-value is computed by calling
105 * the appropriate overloading of
106 * {@link java.util.Arrays#hashCode(long[]) Arrays.hashCode}
107 * on the value. (There is one overloading for each primitive
108 * type, and one for object reference types.)
111 * @return the hash code of this annotation
116 * Returns a string representation of this annotation. The details
117 * of the representation are implementation-dependent, but the following
118 * may be regarded as typical:
120 * @com.acme.util.Name(first=Alfred, middle=E., last=Neuman)
123 * @return a string representation of this annotation
128 * Returns the annotation type of this annotation.
130 Class<? extends Annotation> annotationType();