Package org.jf.dexlib2.iface
Interface AnnotationElement
-
- All Superinterfaces:
java.lang.Comparable<AnnotationElement>
- All Known Implementing Classes:
AnnotationElementRewriter.RewrittenAnnotationElement
,BaseAnnotationElement
,BuilderAnnotationElement
,DexBackedAnnotationElement
,ImmutableAnnotationElement
public interface AnnotationElement extends java.lang.Comparable<AnnotationElement>
This class represents an individual name/value element in an annotation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareTo(AnnotationElement o)
Compares this AnnotationElement to another AnnotationElement.boolean
equals(java.lang.Object o)
Compares this AnnotationElement to another AnnotationElement for equality.java.lang.String
getName()
Gets the name of the element.EncodedValue
getValue()
Gets the value of the element.int
hashCode()
Returns a hashcode for this AnnotationElement.
-
-
-
Method Detail
-
getName
@Nonnull java.lang.String getName()
Gets the name of the element.- Returns:
- The name of the element.
-
getValue
@Nonnull EncodedValue getValue()
Gets the value of the element.- Returns:
- The value of the element
-
hashCode
int hashCode()
Returns a hashcode for this AnnotationElement. This hashCode is defined to be the following:int hashCode = getName().hashCode(); hashCode = hashCode*31 + getValue().hashCode();
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code value for this AnnotationElement
-
equals
boolean equals(@Nullable java.lang.Object o)
Compares this AnnotationElement to another AnnotationElement for equality. This AnnotationElement is equal to another AnnotationElement if all of it's "fields" are equal. That is, if the return values of getName() and getValue() are both equal.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to be compared for equality with this AnnotationElement- Returns:
- true if the specified object is equal to this AnnotationElement
-
compareTo
int compareTo(AnnotationElement o)
Compares this AnnotationElement to another AnnotationElement. The comparison is based on the value of getName() and getValue(), in that order.- Specified by:
compareTo
in interfacejava.lang.Comparable<AnnotationElement>
- Parameters:
o
- The AnnotationElement to compare with this AnnotationElement- Returns:
- An integer representing the result of the comparison
-
-