01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with this
04: * work for additional information regarding copyright ownership. The ASF
05: * licenses this file to you under the Apache License, Version 2.0 (the
06: * "License"); you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations under
15: * the License.
16: */
17:
18: package java.lang.annotation;
19:
20: /**
21: * <p>
22: * The interface implemented by all annotations. This interface is NOT an
23: * annotation itself and any interface that extends this one is NOT an
24: * annotation either.
25: * </p>
26: *
27: * @since 1.5
28: */
29: public interface Annotation {
30:
31: /**
32: * <p>
33: * Returns the type of this annotation.
34: * </p>
35: *
36: * @return A Class instance.
37: */
38: Class<? extends Annotation> annotationType();
39:
40: /**
41: * <p>
42: * Determines whether or not this annotation is equivalent to the annotation
43: * passed.
44: * </p>
45: *
46: * @param obj The object to compare to.
47: * @return <code>true</code> if <code>obj</code> is equal to this,
48: * otherwise <code>false</code>.
49: */
50: boolean equals(Object obj);
51:
52: /**
53: * <p>
54: * Returns the hash value of this annotation.
55: * </p>
56: *
57: * @return The hash value.
58: */
59: int hashCode();
60:
61: /**
62: * <p>
63: * Returns a String representation of this annotation.
64: * </p>
65: *
66: * @return The String that represents this annotation.
67: */
68: String toString();
69: }
|