public enum Primitive extends Enum<Primitive>
Enum Constant and Description |
---|
BOOLEAN
The
boolean type |
BYTE
The
byte type |
CHAR
The
char type |
DOUBLE
The
double type |
FLOAT
The
float type |
INT
The
int type |
LONG
The
long type |
REFERENCE
A reference to a non primitive type
|
SHORT
The
short type |
Modifier and Type | Method and Description |
---|---|
boolean |
booleanValue(Object value)
Convert an object instance to a boolean value
|
byte |
byteValue(Object value)
Convert an object instance to a byte value
|
char |
charValue(Object value)
Convert an object instance to a char value
|
double |
doubleValue(Object value)
Convert an object instance to a double value
|
float |
floatValue(Object value)
Convert an object instance to a float value
|
int |
intValue(Object value)
Convert an object instance to an int value
|
boolean |
isPrimitive()
Indicates if this value represents a primitive type.
|
long |
longValue(Object value)
Convert an object instance to a long value
|
short |
shortValue(Object value)
Convert an object instance to a short value
|
Class<?> |
type()
This primtiive type's
Class instance |
static Primitive |
valueOf(Class<?> type)
Determine the appropriate
Primitive instance for the specified type |
static Primitive |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Primitive[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
PrimitiveWrapper |
wrapper()
Retrieves the equivalent wrapper type for this primitive type
|
Class<?> |
wrapperType()
The wrapper type associated with this type.
|
public static final Primitive BOOLEAN
boolean
typepublic static final Primitive BYTE
byte
typepublic static final Primitive CHAR
char
typepublic static final Primitive DOUBLE
double
typepublic static final Primitive FLOAT
float
typepublic static final Primitive INT
int
typepublic static final Primitive LONG
long
typepublic static final Primitive REFERENCE
public static final Primitive SHORT
short
typepublic static Primitive[] values()
for (Primitive c : Primitive.values()) System.out.println(c);
public static Primitive valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic PrimitiveWrapper wrapper()
PrimitiveWrapper
type for this typepublic boolean booleanValue(Object value)
value
- The value to castpublic byte byteValue(Object value)
value
- The value to castpublic char charValue(Object value)
value
- The value to castpublic double doubleValue(Object value)
value
- The value to castpublic float floatValue(Object value)
value
- The value to castpublic int intValue(Object value)
value
- The value to castpublic final boolean isPrimitive()
REFERENCE
, true otherwisepublic long longValue(Object value)
value
- The value to castpublic short shortValue(Object value)
value
- The value to castpublic Class<?> wrapperType()
int
is Integer