Class MethodSelector

    • Constructor Summary

      Constructors 
      Constructor Description
      MethodSelector​(java.lang.Class<?> javaClass, java.lang.reflect.Method method)  
      MethodSelector​(java.lang.Class<?> javaClass, java.lang.String methodName)  
      MethodSelector​(java.lang.Class<?> javaClass, java.lang.String methodName, java.lang.String methodParameterTypes)  
      MethodSelector​(java.lang.String className, java.lang.String methodName)  
      MethodSelector​(java.lang.String className, java.lang.String methodName, java.lang.String methodParameterTypes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getClassName()
      Get the selected class name.
      java.lang.Class<?> getJavaClass()
      Get the Class in which the selected method is declared, or a subclass thereof.
      java.lang.reflect.Method getJavaMethod()
      Get the selected Method.
      java.lang.String getMethodName()
      Get the selected method name.
      java.lang.String getMethodParameterTypes()
      Get the parameter types for the selected method as a String, typically a comma-separated list of primitive types, fully qualified class names, or array types.
      int hashCode()  
      private void lazyLoadJavaClass()  
      private void lazyLoadJavaMethod()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • className

        private final java.lang.String className
      • methodName

        private final java.lang.String methodName
      • methodParameterTypes

        private final java.lang.String methodParameterTypes
      • javaClass

        private java.lang.Class<?> javaClass
      • javaMethod

        private java.lang.reflect.Method javaMethod
    • Constructor Detail

      • MethodSelector

        MethodSelector​(java.lang.String className,
                       java.lang.String methodName)
      • MethodSelector

        MethodSelector​(java.lang.String className,
                       java.lang.String methodName,
                       java.lang.String methodParameterTypes)
      • MethodSelector

        MethodSelector​(java.lang.Class<?> javaClass,
                       java.lang.String methodName)
      • MethodSelector

        MethodSelector​(java.lang.Class<?> javaClass,
                       java.lang.String methodName,
                       java.lang.String methodParameterTypes)
      • MethodSelector

        MethodSelector​(java.lang.Class<?> javaClass,
                       java.lang.reflect.Method method)
    • Method Detail

      • getClassName

        public java.lang.String getClassName()
        Get the selected class name.
      • getMethodName

        public java.lang.String getMethodName()
        Get the selected method name.
      • getMethodParameterTypes

        public java.lang.String getMethodParameterTypes()
        Get the parameter types for the selected method as a String, typically a comma-separated list of primitive types, fully qualified class names, or array types.

        Note: the parameter types are provided as a single string instead of a collection in order to allow this selector to be used in a generic fashion by various test engines. It is therefore the responsibility of the caller of this method to determine how to parse the returned string.

        Returns:
        the parameter types supplied to this MethodSelector via a constructor or deduced from a Method supplied via a constructor; never null
      • getJavaClass

        public java.lang.Class<?> getJavaClass()
        Get the Class in which the selected method is declared, or a subclass thereof.

        If the Class was not provided, but only the name, this method attempts to lazily load the Class based on its name and throws a PreconditionViolationException if the class cannot be loaded.

        See Also:
        getJavaMethod()
      • getJavaMethod

        public java.lang.reflect.Method getJavaMethod()
        Get the selected Method.

        If the Method was not provided, but only the name, this method attempts to lazily load the Method based on its name and throws a PreconditionViolationException if the method cannot be loaded.

        See Also:
        getJavaClass()
      • lazyLoadJavaClass

        private void lazyLoadJavaClass()
      • lazyLoadJavaMethod

        private void lazyLoadJavaMethod()
      • equals

        @API(status=STABLE,
             since="1.3")
        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        Since:
        1.3
      • hashCode

        @API(status=STABLE,
             since="1.3")
        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        Since:
        1.3
      • toString

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