Class Classes


  • public final class Classes
    extends java.lang.Object
    Utility methods related to Class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.reflect.Method getDeclaredMethod​(java.lang.Class<?> declaringClass, java.lang.String methodName, java.lang.Class<?>... parameterTypes)
      A wrapper for declaringClass.getDeclaredMethod(methodName, parameterTypes) that catches any exception, wraps it in an AssertionError, and throws that.
      static java.lang.Class<?> load​(java.lang.ClassLoader classLoader, java.lang.String className)
      A wrapper for classLoader.loadClass(className) that catches any exception, wraps it in an AssertionError, and throws that.
      static java.lang.Class<?> load​(java.lang.String className)
      Shorthand for load(ClassLoader.getSystemClassLoader(), className).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • load

        public static java.lang.Class<?> load​(java.lang.String className)
        Shorthand for load(ClassLoader.getSystemClassLoader(), className).
      • load

        public static java.lang.Class<?> load​(java.lang.ClassLoader classLoader,
                                              java.lang.String className)
        A wrapper for classLoader.loadClass(className) that catches any exception, wraps it in an AssertionError, and throws that.
      • getDeclaredMethod

        public static java.lang.reflect.Method getDeclaredMethod​(java.lang.Class<?> declaringClass,
                                                                 java.lang.String methodName,
                                                                 java.lang.Class<?>... parameterTypes)
        A wrapper for declaringClass.getDeclaredMethod(methodName, parameterTypes) that catches any exception, wraps it in an AssertionError, and throws that.