Class Primitives


  • public final class Primitives
    extends Object
    A utility class for working with primitives.
    • Method Detail

      • defaultValue

        public static <T> T defaultValue​(Class<T> primitiveType)
        Type Parameters:
        T - the type
        Parameters:
        primitiveType - the primitive type
        Returns:
        the default value for the given type
        Throws:
        IllegalArgumentException - in case primitiveType is not a primitive type
      • boxedType

        public static <T> Class<T> boxedType​(Class<T> primitiveType)
        Type Parameters:
        T - the type
        Parameters:
        primitiveType - the primitive type
        Returns:
        the boxed type
        Throws:
        IllegalArgumentException - in case primitiveType is not a primitive type