Class Primitives

java.lang.Object
is.codion.common.Primitives

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

    • 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