Package org.jf.dexlib2.iface
Interface Annotation
- All Superinterfaces:
BasicAnnotation,Comparable<Annotation>
- All Known Implementing Classes:
AnnotationRewriter.RewrittenAnnotation,BaseAnnotation,BuilderAnnotation,DexBackedAnnotation,ImmutableAnnotation
This class represents a specific instance of an annotation applied to a class/field/method/parameter
-
Method Summary
Modifier and TypeMethodDescriptionintCompares this Annotation to another Annotation.booleanCompares this Annotation to another Annotation for equality.Set<? extends AnnotationElement> Gets a set of the name/value elements associated with this annotation.getType()Gets the type of this annotation.intGets the visibility of this annotation.inthashCode()Returns a hashcode for this Annotation.
-
Method Details
-
getVisibility
int getVisibility()Gets the visibility of this annotation. This will be one of the AnnotationVisibility.* constants.- Returns:
- The visibility of this annotation
-
getType
Gets the type of this annotation. This will be the type descriptor of the class that defines this annotation.- Specified by:
getTypein interfaceBasicAnnotation- Returns:
- The type of this annotation
-
getElements
Gets a set of the name/value elements associated with this annotation. The elements in the returned set will be unique with respect to the element name.- Specified by:
getElementsin interfaceBasicAnnotation- Returns:
- A set of AnnotationElements
-
hashCode
int hashCode()Returns a hashcode for this Annotation. This hashCode is defined to be the following:int hashCode = getVisibility(); hashCode = hashCode*31 + getType().hashCode(); hashCode = hashCode*31 + getElements().hashCode(); -
equals
Compares this Annotation to another Annotation for equality. This Annotation is equal to another Annotation if all of it's "fields" are equal. That is, if the return values of getVisibility(), getType(), and getElements() are all equal. -
compareTo
Compares this Annotation to another Annotation. The comparison is based on the value of getVisibility(), getType() and getElements(), in that order. When comparing the set of elements, the comparison is done with the semantics of org.jf.util.CollectionUtils.compareAsSet(), using the natural ordering of AnnotationElement.- Specified by:
compareToin interfaceComparable<Annotation>- Parameters:
o- The Annotation to compare with this Annotation- Returns:
- An integer representing the result of the comparison
-