Package org.jf.dexlib2.iface.reference
Interface MethodReference
-
- All Superinterfaces:
java.lang.Comparable<MethodReference>
,Reference
- All Known Subinterfaces:
Method
- All Known Implementing Classes:
BaseMethodReference
,BuilderMethod
,BuilderMethodReference
,DexBackedMethod
,DexBackedMethodReference
,ImmutableMethod
,ImmutableMethodReference
,MethodReferenceRewriter.RewrittenMethodReference
,MethodRewriter.RewrittenMethod
,ReflectionConstructor
,ReflectionMethod
public interface MethodReference extends Reference, java.lang.Comparable<MethodReference>
This class represents a reference to a method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareTo(MethodReference o)
Compare this MethodReference to another MethodReference.boolean
equals(java.lang.Object o)
Compares this MethodReference to another MethodReference for equality.java.lang.String
getDefiningClass()
Gets the type of the class that defines the referenced method.java.lang.String
getName()
Gets the name of the referenced method.java.util.List<? extends java.lang.CharSequence>
getParameterTypes()
Gets a list of the types of the parameters of this method.java.lang.String
getReturnType()
Gets the return type of the referenced method.int
hashCode()
Returns a hashcode for this MethodReference.-
Methods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
-
-
-
Method Detail
-
getDefiningClass
@Nonnull java.lang.String getDefiningClass()
Gets the type of the class that defines the referenced method.- Returns:
- The type of the class that defines the referenced method
-
getName
@Nonnull java.lang.String getName()
Gets the name of the referenced method.- Returns:
- The name of the referenced method
-
getParameterTypes
@Nonnull java.util.List<? extends java.lang.CharSequence> getParameterTypes()
Gets a list of the types of the parameters of this method.- Returns:
- A list of the parameter types of this method, as strings.
-
getReturnType
@Nonnull java.lang.String getReturnType()
Gets the return type of the referenced method.- Returns:
- The return type of the referenced method.
-
hashCode
int hashCode()
Returns a hashcode for this MethodReference. This hashCode is defined to be the following:int hashCode = getDefiningClass().hashCode(); hashCode = hashCode*31 + getName().hashCode(); hashCode = hashCode*31 + getReturnType().hashCode(); hashCode = hashCode*31 + CharSequenceUtils.listHashCode(getParameters());
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code value for this MethodReference
-
equals
boolean equals(@Nullable java.lang.Object o)
Compares this MethodReference to another MethodReference for equality. This MethodReference is equal to another MethodReference if all of it's "fields" are equal. That is, if the return values of getDefiningClass(), getName(), getReturnType() and getParameterTypes() are all equal. Equality for getParameters() should be tested by comparing the string representation of each element. I.e. CharSequenceUtils.listEquals(this.getParameterTypes(), other.getParameterTypes())- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to be compared for equality with this MethodReference- Returns:
- true if the specified object is equal to this MethodReference
-
compareTo
int compareTo(@Nonnull MethodReference o)
Compare this MethodReference to another MethodReference. The comparison is based on the comparison of the return values of getDefiningClass(), getName(), getReturnType() and getParameters(), in that order. getParameters() should be compared using the semantics of org.jf.util.CollectionUtils.compareAsList()- Specified by:
compareTo
in interfacejava.lang.Comparable<MethodReference>
- Parameters:
o
- The MethodReference to compare with this MethodReference- Returns:
- An integer representing the result of the comparison
-
-