Class IntrospectionUtils

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<?> getBoxedClass​(java.lang.Class clazz)
      returns boxed type (or input type if not a primitive type)
      static java.lang.Class<?> getTypeClass​(java.lang.reflect.Type type)
      returns the Class corresponding to a Type, if possible
      static java.lang.Class<?> getUnboxedClass​(java.lang.Class clazz)
      returns unboxed type (or input type if not successful)
      static boolean isMethodInvocationConvertible​(java.lang.reflect.Type formal, java.lang.Class<?> actual, boolean possibleVarArg)
      Determines whether a type represented by a class object is convertible to another type represented by a class object using a method invocation conversion, treating object types of primitive types as if they were primitive types (that is, a Boolean actual parameter type matches boolean primitive formal type).
      static boolean isStrictMethodInvocationConvertible​(java.lang.reflect.Type formal, java.lang.Class<?> actual, boolean possibleVarArg)
      Determines whether a type represented by a class object is convertible to another type represented by a class object using a method invocation conversion, without matching object and primitive types.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntrospectionUtils

        public IntrospectionUtils()
    • Method Detail

      • getBoxedClass

        public static java.lang.Class<?> getBoxedClass​(java.lang.Class clazz)
        returns boxed type (or input type if not a primitive type)
        Parameters:
        clazz - input class
        Returns:
        boxed class
      • getUnboxedClass

        public static java.lang.Class<?> getUnboxedClass​(java.lang.Class clazz)
        returns unboxed type (or input type if not successful)
        Parameters:
        clazz - input class
        Returns:
        unboxed class
      • getTypeClass

        public static java.lang.Class<?> getTypeClass​(java.lang.reflect.Type type)
        returns the Class corresponding to a Type, if possible
        Parameters:
        type - the input Type
        Returns:
        found Class, if any
      • isMethodInvocationConvertible

        public static boolean isMethodInvocationConvertible​(java.lang.reflect.Type formal,
                                                            java.lang.Class<?> actual,
                                                            boolean possibleVarArg)
        Determines whether a type represented by a class object is convertible to another type represented by a class object using a method invocation conversion, treating object types of primitive types as if they were primitive types (that is, a Boolean actual parameter type matches boolean primitive formal type). This behavior is because this method is used to determine applicable methods for an actual parameter list, and primitive types are represented by their object duals in reflective method calls.
        Parameters:
        formal - the formal parameter type to which the actual parameter type should be convertible
        actual - the actual parameter type.
        possibleVarArg - whether or not we're dealing with the last parameter in the method declaration
        Returns:
        true if either formal type is assignable from actual type, or formal is a primitive type and actual is its corresponding object type or an object type of a primitive type that can be converted to the formal type.
      • isStrictMethodInvocationConvertible

        public static boolean isStrictMethodInvocationConvertible​(java.lang.reflect.Type formal,
                                                                  java.lang.Class<?> actual,
                                                                  boolean possibleVarArg)
        Determines whether a type represented by a class object is convertible to another type represented by a class object using a method invocation conversion, without matching object and primitive types. This method is used to determine the more specific type when comparing signatures of methods.
        Parameters:
        formal - the formal parameter type to which the actual parameter type should be convertible
        actual - the actual parameter type.
        possibleVarArg - whether or not we're dealing with the last parameter in the method declaration
        Returns:
        true if either formal type is assignable from actual type, or formal and actual are both primitive types and actual can be subject to widening conversion to formal.