Package org.postgresql.util

# Class ClassUtils

java.lang.Object
org.postgresql.util.ClassUtils

public final class ClassUtils extends Object
Utility class for safe class loading operations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <T> Class<? extends T>`
  `forName(String className, Class<T> expectedClass, @Nullable ClassLoader classLoader)`
  Safely loads a class using the three-parameter Class.forName with initialize=false and validates it's assignable to the expected type.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### forName

    public static <T> Class<? extends T> forName(String className, Class<T> expectedClass, @Nullable ClassLoader classLoader) throws ClassNotFoundException
    Safely loads a class using the three-parameter Class.forName with initialize=false and validates it's assignable to the expected type.
    Type Parameters:
      `T` - the expected type
    Parameters:
      `className` - the name of the class to load
      `expectedClass` - the expected superclass or interface
      `classLoader` - the class loader to use
    Returns:
      the loaded class as a subclass of the expected type
    Throws:
      `ClassNotFoundException` - if the class cannot be found