py4j.reflection

## Class TypeUtil

- java.lang.Object
- - py4j.reflection.TypeUtil

-     public class TypeUtil
      extends Object

  This class is responsible for the type conversion between Python types and Java types.

  Author:
    Barthelemy Dagenais

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DISTANCE_FACTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `computeCharacterConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters)`
    `static int` | `computeDistance(Class<?> parent, Class<?> child)`
    `static int` | `computeNumericConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters)`
    `static Class<?>` | `forName(String fqn)`
    `static Class<?>` | `forName(String fqn, JVMView view)`
    `static Class<?>` | `getClass(String simpleName, JVMView view)`
    `static int` | `getCost(Class<?> parent, Class<?> child)`
    `static String` | `getName(String name, boolean shortName)`
    `static String[]` | `getNames(Class<?>[] classes)`
    `static String` | `getPackage(String name)`
    `static int` | `getPoint(Class<?> clazz)`
    `static boolean` | `isBoolean(Class<?> clazz)`
    `static boolean` | `isByte(Class<?> clazz)`
    `static boolean` | `isCharacter(Class<?> clazz)`
    `static boolean` | `isDouble(Class<?> clazz)`
    `static boolean` | `isFloat(Class<?> clazz)`
    `static boolean` | `isInstanceOf(Class<?> clazz, Object object)` Checks if an object is an instance of a given class.
    `static boolean` | `isInstanceOf(String classFQN, Object object)` Checks if an object is an instance of a given class.
    `static boolean` | `isInteger(Class<?> clazz)`
    `static boolean` | `isLong(Class<?> clazz)`
    `static boolean` | `isNumeric(Class<?> clazz)`
    `static boolean` | `isShort(Class<?> clazz)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DISTANCE_FACTOR

          public static final int DISTANCE_FACTOR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TypeUtil

          public TypeUtil()

  - ### Method Detail

    - #### computeCharacterConversion

          public static int computeCharacterConversion(Class<?> parent,
                                                       Class<?> child,
                                                       List<TypeConverter> converters)

    - #### computeDistance

          public static int computeDistance(Class<?> parent,
                                            Class<?> child)

    - #### computeNumericConversion

          public static int computeNumericConversion(Class<?> parent,
                                                     Class<?> child,
                                                     List<TypeConverter> converters)

    - #### forName

          public static Class<?> forName(String fqn)
                                  throws ClassNotFoundException

      Throws:
        `ClassNotFoundException`

    - #### forName

          public static Class<?> forName(String fqn,
                                         JVMView view)
                                  throws ClassNotFoundException

      Throws:
        `ClassNotFoundException`

    - #### getClass

          public static Class<?> getClass(String simpleName,
                                          JVMView view)
                                   throws ClassNotFoundException

      Throws:
        `ClassNotFoundException`

    - #### getCost

          public static int getCost(Class<?> parent,
                                    Class<?> child)

    - #### getName

          public static String getName(String name,
                                       boolean shortName)

    - #### getNames

          public static String[] getNames(Class<?>[] classes)

    - #### getPackage

          public static String getPackage(String name)

    - #### getPoint

          public static int getPoint(Class<?> clazz)

    - #### isBoolean

          public static boolean isBoolean(Class<?> clazz)

    - #### isByte

          public static boolean isByte(Class<?> clazz)

    - #### isCharacter

          public static boolean isCharacter(Class<?> clazz)

    - #### isDouble

          public static boolean isDouble(Class<?> clazz)

    - #### isFloat

          public static boolean isFloat(Class<?> clazz)

    - #### isInteger

          public static boolean isInteger(Class<?> clazz)

    - #### isLong

          public static boolean isLong(Class<?> clazz)

    - #### isNumeric

          public static boolean isNumeric(Class<?> clazz)

    - #### isShort

          public static boolean isShort(Class<?> clazz)

    - #### isInstanceOf

          public static boolean isInstanceOf(Class<?> clazz,
                                             Object object)

      Checks if an object is an instance of a given class.

      Parameters:
        `clazz` - The class to check
        `object` - The object
      Returns:
        True if object is an instance of clazz.

    - #### isInstanceOf

          public static boolean isInstanceOf(String classFQN,
                                             Object object)

      Checks if an object is an instance of a given class.

      Parameters:
        `classFQN` - The fully qualified name of a class to check
        `object` - The object
      Returns:
        True if object is an instance of the class.