Class ExecutableHelper


  • public final class ExecutableHelper
    extends Object
    Provides shared functionality dealing with executables.
    Author:
    Hardy Ferentschik, Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
    • Method Detail

      • overrides

        public boolean overrides​(Callable subTypeMethod,
                                 Callable superTypeMethod)
      • overrides

        public boolean overrides​(Method subTypeMethod,
                                 Method superTypeMethod)
        Checks, whether subTypeMethod overrides superTypeMethod.
        Parameters:
        subTypeMethod - The sub type method (cannot be null).
        superTypeMethod - The super type method (cannot be null).
        Returns:
        Returns true if subTypeMethod overrides superTypeMethod, false otherwise.
      • isResolvedToSameMethodInHierarchy

        public boolean isResolvedToSameMethodInHierarchy​(Class<?> mainSubType,
                                                         Method left,
                                                         Method right)
        Checks if a pair of given methods (left and right) are resolved to the same method based on the mainSubType type.
        Parameters:
        mainSubType - a type at the bottom of class hierarchy to be used to lookup the methods.
        left - one of the methods to check
        right - another of the methods to check
        Returns:
        true if a pair of methods are equal left == right, or one of the methods override another one in the class hierarchy with mainSubType at the bottom, false otherwise.
      • getExecutableAsString

        public static String getExecutableAsString​(String name,
                                                   Class<?>... parameterTypes)
        Returns a string representation of an executable with the given name and parameter types in the form <name>(<parameterType 0> ... <parameterType n>), e.g. for logging purposes.
        Parameters:
        name - the name of the executable
        parameterTypes - the types of the executable's parameters
        Returns:
        A string representation of the given executable.