Class Primitives


  • public final class Primitives
    extends Object
    Contains static utility methods pertaining to primitive types and their corresponding wrapper types.
    Since:
    1.0
    Author:
    Kevin Bourrillion
    • Method Detail

      • wrap

        public static <T> Class<T> wrap​(Class<T> type)
        Returns the corresponding wrapper type of type if it is a primitive type; otherwise returns type itself. Idempotent.
             wrap(int.class) == Integer.class
             wrap(Integer.class) == Integer.class
             wrap(String.class) == String.class