public final class Primitives
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map |
BOX |
private static java.util.Map |
NAMED_PRIMITIVE |
private static java.util.Map |
REPRESENTING_CHAR |
private static java.util.Map |
UNBOX |
| Constructor and Description |
|---|
Primitives() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Class |
box(java.lang.Class type)
Get the boxed type for a primitive.
|
static boolean |
isBoxed(java.lang.Class type)
Check for a boxed type.
|
static java.lang.Class |
primitiveType(java.lang.String name)
Get the primitive type by name.
|
static char |
representingChar(java.lang.Class type)
Get the representing character of a primitive type.
|
static java.lang.Class |
unbox(java.lang.Class type)
Get the primitive type for a boxed one.
|
private static final java.util.Map BOX
private static final java.util.Map UNBOX
private static final java.util.Map NAMED_PRIMITIVE
private static final java.util.Map REPRESENTING_CHAR
public static java.lang.Class box(java.lang.Class type)
type - the primitive typepublic static java.lang.Class unbox(java.lang.Class type)
type - the boxed typepublic static boolean isBoxed(java.lang.Class type)
type - the type to checktrue if the type is boxedpublic static java.lang.Class primitiveType(java.lang.String name)
name - the name of the typenullpublic static char representingChar(java.lang.Class type)
type - the primitive type