Class BaseMethodReference

    • Constructor Detail

      • BaseMethodReference

        public BaseMethodReference()
    • Method Detail

      • hashCode

        public int hashCode()
        Description copied from interface: MethodReference
        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());
         
        Specified by:
        hashCode in interface MethodReference
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code value for this MethodReference
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object o)
        Description copied from interface: MethodReference
        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())
        Specified by:
        equals in interface MethodReference
        Overrides:
        equals in class java.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

        public int compareTo​(@Nonnull
                             MethodReference o)
        Description copied from interface: MethodReference
        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 interface java.lang.Comparable<MethodReference>
        Specified by:
        compareTo in interface MethodReference
        Parameters:
        o - The MethodReference to compare with this MethodReference
        Returns:
        An integer representing the result of the comparison
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object