Class Primitives

java.lang.Object
com.thoughtworks.xstream.core.util.Primitives

public final class Primitives extends Object
Utility class for primitives.
Since:
1.2.1
  • Field Details

    • BOX

      private static final Map BOX
    • UNBOX

      private static final Map UNBOX
    • NAMED_PRIMITIVE

      private static final Map NAMED_PRIMITIVE
    • REPRESENTING_CHAR

      private static final Map REPRESENTING_CHAR
  • Constructor Details

    • Primitives

      public Primitives()
  • Method Details

    • box

      public static Class box(Class type)
      Get the boxed type for a primitive.
      Parameters:
      type - the primitive type
      Returns:
      the boxed type or null
    • unbox

      public static Class unbox(Class type)
      Get the primitive type for a boxed one.
      Parameters:
      type - the boxed type
      Returns:
      the primitive type or null
    • isBoxed

      public static boolean isBoxed(Class type)
      Check for a boxed type.
      Parameters:
      type - the type to check
      Returns:
      true if the type is boxed
      Since:
      1.4
    • primitiveType

      public static Class primitiveType(String name)
      Get the primitive type by name.
      Parameters:
      name - the name of the type
      Returns:
      the Java type or null
      Since:
      1.4
    • representingChar

      public static char representingChar(Class type)
      Get the representing character of a primitive type.
      Parameters:
      type - the primitive type
      Returns:
      the representing character or 0
      Since:
      1.4