Class LettuceClassUtils


  • public class LettuceClassUtils
    extends Object
    Miscellaneous class utility methods. Mainly for internal use within the framework.
    Since:
    4.2
    Author:
    Mark Paluch
    • Field Detail

      • CGLIB_CLASS_SEPARATOR

        public static final String CGLIB_CLASS_SEPARATOR
        The CGLIB class separator character "$$"
        See Also:
        Constant Field Values
    • Constructor Detail

      • LettuceClassUtils

        public LettuceClassUtils()
    • Method Detail

      • isPresent

        public static boolean isPresent​(String className)
        Determine whether the Class identified by the supplied name is present and can be loaded. Will return false 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
      • 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 type
        rhsType - the value type that should be assigned to the target type
        Returns:
        if the target type is assignable from the value type