Package org.jf.dexlib2.base
Class BaseAnnotationElement
- java.lang.Object
-
- org.jf.dexlib2.base.BaseAnnotationElement
-
- All Implemented Interfaces:
java.lang.Comparable<AnnotationElement>
,AnnotationElement
- Direct Known Subclasses:
AnnotationElementRewriter.RewrittenAnnotationElement
,BuilderAnnotationElement
,DexBackedAnnotationElement
,ImmutableAnnotationElement
public abstract class BaseAnnotationElement extends java.lang.Object implements AnnotationElement
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<AnnotationElement>
BY_NAME
-
Constructor Summary
Constructors Constructor Description BaseAnnotationElement()
-
Method Summary
All Methods Instance Methods Concrete 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.int
hashCode()
Returns a hashcode for this AnnotationElement.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jf.dexlib2.iface.AnnotationElement
getName, getValue
-
-
-
-
Field Detail
-
BY_NAME
public static final java.util.Comparator<AnnotationElement> BY_NAME
-
-
Method Detail
-
hashCode
public int hashCode()
Description copied from interface:AnnotationElement
Returns a hashcode for this AnnotationElement. This hashCode is defined to be the following:int hashCode = getName().hashCode(); hashCode = hashCode*31 + getValue().hashCode();
- Specified by:
hashCode
in interfaceAnnotationElement
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code value for this AnnotationElement
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:AnnotationElement
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.- Specified by:
equals
in interfaceAnnotationElement
- 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
public int compareTo(AnnotationElement o)
Description copied from interface:AnnotationElement
Compares this AnnotationElement to another AnnotationElement. The comparison is based on the value of getName() and getValue(), in that order.- Specified by:
compareTo
in interfaceAnnotationElement
- 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
-
-