Class Util


  • public final class Util
    extends Object
    • Method Detail

      • classForName

        public static <T> Class<T> classForName​(String className)
        Helper method to resolve a Class of a given name.
        Type Parameters:
        T - The type of the class to resolve.
        Parameters:
        className - The fully qualified name of the class to resolve.
        Returns:
        The corresponding class if it exists, null otherwise.
      • classes

        public static Class<?>[] classes​(Class<?>... classes)
        Helper method to create an array of Classes.
        Parameters:
        classes - The classes to construct an array out of.
        Returns:
        An array with the given classes.
      • objects

        public static Object[] objects()
        Helper method to create an empty array of Objects.
        Returns:
        An empty array.
      • objects

        public static Object[] objects​(Object first)
        Helper method to create an array of Objects.
        Parameters:
        first - The object to construct an array out of.
        Returns:
        An array with the given object.
      • objects

        public static Object[] objects​(Object first,
                                       Object second)
        Helper method to create an array of Objects.
        Parameters:
        first - The first object to construct an array out of.
        second - The second object in the array.
        Returns:
        An array with the given objects.
      • objects

        public static Object[] objects​(Object first,
                                       Object second,
                                       Object third)
        Helper method to create an array of Objects.
        Parameters:
        first - The first object to construct an array out of.
        second - The second object in the array.
        third - The third object in the array.
        Returns:
        An array with the given objects.
      • setOf

        @SafeVarargs
        public static <T> Set<T> setOf​(T... ts)
        Helper method to create a set of object.
        Type Parameters:
        T - The type of objects to add to the set.
        Parameters:
        ts - The objects to add to the set.
        Returns:
        A set with the given objets.