Top Description Fields Constructors Methods
com.thoughtworks.xstream.core.util

public final Class Primitives

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map

Utility class for primitives.
Author
Jörg Schaible
Since
1.2.1

Field Summary

Modifier and TypeField and Description
private static final Map<K, V>
private static final Map<K, V>
private static final Map<K, V>
private static final Map<K, V>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Class<T>

Returns:

the boxed type or null
box
(final Class<T>
the primitive type
type
)

Get the boxed type for a primitive.

public static boolean

Returns:

true if the type is boxed
isBoxed
(final Class<T>
the type to check
type
)

Check for a boxed type.

public static Class<T>

Returns:

the Java type or null
primitiveType
(final String
the name of the type
name
)

Get the primitive type by name.

public static char

Returns:

the representing character or 0
representingChar
(final Class<T>
the primitive type
type
)

Get the representing character of a primitive type.

public static Class<T>

Returns:

the primitive type or null
unbox
(final Class<T>
the boxed type
type
)

Get the primitive type for a boxed one.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOXback to summary
private static final Map<K, V> BOX
NAMED_PRIMITIVEback to summary
private static final Map<K, V> NAMED_PRIMITIVE
REPRESENTING_CHARback to summary
private static final Map<K, V> REPRESENTING_CHAR
UNBOXback to summary
private static final Map<K, V> UNBOX

Constructor Detail

Primitivesback to summary
public Primitives()

Method Detail

boxback to summary
public static Class<T> box(final Class<T> type)

Get the boxed type for a primitive.

Parameters
type:Class<T>

the primitive type

Returns:Class<T>

the boxed type or null

isBoxedback to summary
public static boolean isBoxed(final Class<T> type)

Check for a boxed type.

Parameters
type:Class<T>

the type to check

Returns:boolean

true if the type is boxed

Since
1.4
primitiveTypeback to summary
public static Class<T> primitiveType(final String name)

Get the primitive type by name.

Parameters
name:String

the name of the type

Returns:Class<T>

the Java type or null

Since
1.4
representingCharback to summary
public static char representingChar(final Class<T> type)

Get the representing character of a primitive type.

Parameters
type:Class<T>

the primitive type

Returns:char

the representing character or 0

Since
1.4
unboxback to summary
public static Class<T> unbox(final Class<T> type)

Get the primitive type for a boxed one.

Parameters
type:Class<T>

the boxed type

Returns:Class<T>

the primitive type or null