Class SignatureKey

    • Constructor Detail

      • SignatureKey

        public SignatureKey​(Method method)
        Creates a SignatureKey from the method.
        Parameters:
        method - The method from which to create the signature
      • SignatureKey

        public SignatureKey​(String name,
                            Class<?>... parameterTypes)
        Creates a SignatureKey from the given name and parameter types.
        Parameters:
        name - The method name
        parameterTypes - The method parameter types
    • Method Detail

      • methodComparator

        public static Comparator<Method> methodComparator()
        Returns a Comparator that compares two methods on the basis of their signatures.
        Returns:
        The method comparator
      • getName

        public String getName()
        Gets the method name.
        Returns:
        The method name
      • getParameterTypes

        public Class<?>[] getParameterTypes()
        Gets the parameter types to the method.
        Returns:
        The parameter types
      • equals

        public boolean equals​(Object o)
        Equality of method signatures is done strictly on method name and parameter types.
        Overrides:
        equals in class Object
        Parameters:
        o - The object to compare for equality
        Returns:
        True if equal
      • hashCode

        public int hashCode()
        Returns the hash code.
        Overrides:
        hashCode in class Object
        Returns:
        The hash code
      • compareTo

        public int compareTo​(SignatureKey other)
        Compares two signatures on method name, number of parameters, and finally the parameter types themselves.
        Specified by:
        compareTo in interface Comparable<SignatureKey>
        Parameters:
        other - The other signature
        Returns:
        0 if equal, negative int if this is less than other, positive int if otherwise