Class Primitives
java.lang.Object
com.thoughtworks.xstream.core.util.Primitives
Utility class for primitives.
- Since:
- 1.2.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class
Get the boxed type for a primitive.static boolean
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
Get the primitive type for a boxed one.
-
Field Details
-
BOX
-
UNBOX
-
NAMED_PRIMITIVE
-
REPRESENTING_CHAR
-
-
Constructor Details
-
Primitives
public Primitives()
-
-
Method Details
-
box
Get the boxed type for a primitive.- Parameters:
type
- the primitive type- Returns:
- the boxed type or null
-
unbox
Get the primitive type for a boxed one.- Parameters:
type
- the boxed type- Returns:
- the primitive type or null
-
isBoxed
Check for a boxed type.- Parameters:
type
- the type to check- Returns:
true
if the type is boxed- Since:
- 1.4
-
primitiveType
Get the primitive type by name.- Parameters:
name
- the name of the type- Returns:
- the Java type or
null
- Since:
- 1.4
-
representingChar
Get the representing character of a primitive type.- Parameters:
type
- the primitive type- Returns:
- the representing character or 0
- Since:
- 1.4
-