com.thoughtworks.xstream.core.util
Class Primitives

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

public final class Primitives
extends Object

Utility class for primitives.

Since:
1.2.1
Author:
Jörg Schaible

Constructor Summary
Primitives()
           
 
Method Summary
static Class box(Class type)
          Get the boxed type for a primitive.
static boolean isBoxed(Class type)
          Check for a boxed type.
static Class primitiveType(String name)
          Get the primitive type by name.
static char representingChar(Class type)
          Get the representing character of a primitive type.
static Class unbox(Class type)
          Get the primitive type for a boxed one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Primitives

public Primitives()
Method Detail

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


Copyright © 2012. All Rights Reserved.