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 StringCGLIB_CLASS_SEPARATORThe CGLIB class separator character "$$" -
Constructor Summary
Constructors Constructor Description LettuceClassUtils() -
Method Summary
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 booleanisAssignable(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 booleanisPresent(String className)Determine whether theClassidentified by the supplied name is present and can be loaded.
-
Field Details
-
CGLIB_CLASS_SEPARATOR
The CGLIB class separator character "$$"- See Also:
- Constant Field Values
-
-
Constructor Details
-
LettuceClassUtils
public LettuceClassUtils()
-
-
Method Details
-
isPresent
Determine whether theClassidentified by the supplied name is present and can be loaded. Will returnfalseif 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
Loads a class using thegetDefaultClassLoader().- Parameters:
className-- Returns:
-
forName
Loads a class using thegetDefaultClassLoader().- Parameters:
className-- Returns:
- Throws:
ClassNotFoundException
-
isAssignable
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
-