Module lettuce.core

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 Details

    • CGLIB_CLASS_SEPARATOR

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

    • LettuceClassUtils

      public LettuceClassUtils()
  • Method Details

    • 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
    • findClass

      public static Class<?> findClass​(String className)
      Loads a class using the getDefaultClassLoader().
      Parameters:
      className -
      Returns:
    • forName

      public static Class<?> forName​(String className) throws ClassNotFoundException
      Loads a class using the getDefaultClassLoader().
      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 type
      rhsType - the value type that should be assigned to the target type
      Returns:
      if the target type is assignable from the value type