Package io.lettuce.core.internal
Class LettuceClassUtils
- java.lang.Object
-
- io.lettuce.core.internal.LettuceClassUtils
-
public class LettuceClassUtils extends Object
Miscellaneous class utility methods. Mainly for internal use within the framework.- Since:
- 4.2
- Author:
- Mark Paluch
-
-
Field Summary
Fields Modifier and Type Field Description static String
CGLIB_CLASS_SEPARATOR
The CGLIB class separator character "$$"
-
Constructor Summary
Constructors Constructor Description LettuceClassUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>
findClass(String className)
Loads a class using thegetDefaultClassLoader()
.static Class<?>
forName(String className)
Loads a class using thegetDefaultClassLoader()
.static boolean
isAssignable(Class<?> lhsType, Class<?> rhsType)
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection.static boolean
isPresent(String className)
Determine whether theClass
identified by the supplied name is present and can be loaded.
-
-
-
Field Detail
-
CGLIB_CLASS_SEPARATOR
public static final String CGLIB_CLASS_SEPARATOR
The CGLIB class separator character "$$"- See Also:
- Constant Field Values
-
-
Method Detail
-
isPresent
public static boolean isPresent(String className)
Determine whether theClass
identified by the supplied name is present and can be loaded. Will returnfalse
if either the class or one of its dependencies is not present or cannot be loaded.- Parameters:
className
- the name of the class to check- Returns:
- whether the specified class is present
-
findClass
public static Class<?> findClass(String className)
Loads a class using thegetDefaultClassLoader()
.- Parameters:
className
-- Returns:
-
forName
public static Class<?> forName(String className) throws ClassNotFoundException
Loads a class using thegetDefaultClassLoader()
.- Parameters:
className
-- Returns:
- Throws:
ClassNotFoundException
-
isAssignable
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType)
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection. Considers primitive wrapper classes as assignable to the corresponding primitive types.- Parameters:
lhsType
- the target typerhsType
- the value type that should be assigned to the target type- Returns:
- if the target type is assignable from the value type
-
-