Package py4j.reflection
Class TypeUtil
java.lang.Object
py4j.reflection.TypeUtil
This class is responsible for the type conversion between Python types and Java types.
- Author:
- Barthelemy Dagenais
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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<?>
static Class<?>
static Class<?>
static int
static String
static String
getPackage
(String name) static int
static boolean
static boolean
static boolean
isCharacter
(Class<?> clazz) static boolean
static boolean
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
static boolean
static boolean
static boolean
-
Field Details
-
DISTANCE_FACTOR
public static final int DISTANCE_FACTOR- See Also:
-
-
Constructor Details
-
TypeUtil
public TypeUtil()
-
-
Method Details
-
computeCharacterConversion
public static int computeCharacterConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters) -
computeDistance
-
computeNumericConversion
public static int computeNumericConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters) -
forName
- Throws:
ClassNotFoundException
-
forName
- Throws:
ClassNotFoundException
-
getClass
- Throws:
ClassNotFoundException
-
getCost
-
getName
-
getNames
-
getPackage
-
getPoint
-
isBoolean
-
isByte
-
isCharacter
-
isDouble
-
isFloat
-
isInteger
-
isLong
-
isNumeric
-
isShort
-
isInstanceOf
Checks if an object is an instance of a given class.
- Parameters:
clazz
- The class to checkobject
- The object- Returns:
- True if object is an instance of clazz.
-
isInstanceOf
Checks if an object is an instance of a given class.
- Parameters:
classFQN
- The fully qualified name of a class to checkobject
- The object- Returns:
- True if object is an instance of the class.
-