Class Utils


  • public final class Utils
    extends java.lang.Object
    Generic utilities.
    Since:
    30.06.2014
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkNoParams​(java.lang.reflect.Method method)
      Checks that method has no parameters, otherwise throws exception.
      static boolean isJava8()
      Note: versions below 1.8 are not supported.
      static boolean isPackageValid​(java.lang.Class type)
      Important check, because JDK proxies of public interfaces have no package (thanks to @binkley https://github.com/99soft/lifegycle/pull/5).
      • Methods inherited from class java.lang.Object

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

      • isPackageValid

        public static boolean isPackageValid​(java.lang.Class type)
        Important check, because JDK proxies of public interfaces have no package (thanks to @binkley https://github.com/99soft/lifegycle/pull/5).
        Parameters:
        type - class type to check
        Returns:
        true if package could be resolved, false otherwise
      • checkNoParams

        public static void checkNoParams​(java.lang.reflect.Method method)
        Checks that method has no parameters, otherwise throws exception.
        Parameters:
        method - method to check
      • isJava8

        public static boolean isJava8()
        Note: versions below 1.8 are not supported.
        Returns:
        true if current java is 1.8, otherwise assumed 9 or above