Package com.android.dx.rop.annotation
Class Annotation
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.rop.annotation.Annotation
- All Implemented Interfaces:
ToHuman
,Comparable<Annotation>
An annotation on an element of a class. Annotations have an
associated type and additionally consist of a set of (name, value)
pairs, where the names are unique.
-
Constructor Summary
ConstructorDescriptionAnnotation
(CstType type, AnnotationVisibility visibility) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(NameValuePair pair) Add an element to the set of (name, value) pairs for this instance.int
compareTo
(Annotation other) boolean
Gets the set of name-value pairs contained in this instance.getType()
Gets the type of this instance.Gets the visibility of this instance.int
hashCode()
void
put
(NameValuePair pair) Put an element into the set of (name, value) pairs for this instance.toHuman()
Return the "human" string form of this instance.toString()
Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
-
Constructor Details
-
Annotation
Construct an instance. It initially contains no elements.- Parameters:
type
-non-null;
type of the annotationvisibility
-non-null;
the visibility of the annotation
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Annotation>
-
toString
-
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
. -
getType
Gets the type of this instance.- Returns:
non-null;
the type
-
getVisibility
Gets the visibility of this instance.- Returns:
non-null;
the visibility
-
put
Put an element into the set of (name, value) pairs for this instance. If there is a preexisting element with the same name, it will be replaced by this method.- Parameters:
pair
-non-null;
the (name, value) pair to place into this instance
-
add
Add an element to the set of (name, value) pairs for this instance. It is an error to call this method if there is a preexisting element with the same name.- Parameters:
pair
-non-null;
the (name, value) pair to add to this instance
-
getNameValuePairs
Gets the set of name-value pairs contained in this instance. The result is always unmodifiable.- Returns:
non-null;
the set of name-value pairs
-