TUM CCSM Commons

edu.tum.cs.commons.reflect
Enum EJavaPrimitive

java.lang.Object
  extended by java.lang.Enum<EJavaPrimitive>
      extended by edu.tum.cs.commons.reflect.EJavaPrimitive
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EJavaPrimitive>

public enum EJavaPrimitive
extends java.lang.Enum<EJavaPrimitive>

Enumeration of Java primitives.

Version:
$Rev: 26283 $
Author:
deissenb, $Author: juergens $
Rating:
GREEN Hash: 7E5359C46ADC381B3A4FEC22DC494CBC

Enum Constant Summary
BOOLEAN
          boolean
BYTE
          byte
CHAR
          char
DOUBLE
          double
FLOAT
          float
INT
          int
LONG
          long
SHORT
          short
VOID
          void
 
Method Summary
 java.lang.Class<?> getClassObject()
          Get the class object of the primitive.
static EJavaPrimitive getForPrimitiveClass(java.lang.Class<?> clazz)
          Returns the enum literal belonging to the given primitive class (or null).
static EJavaPrimitive getForPrimitiveOrWrapperClass(java.lang.Class<?> clazz)
          Returns the enum literal belonging to the given primitive or wrapper class (or null).
static EJavaPrimitive getForWrapperClass(java.lang.Class<?> clazz)
          Returns the enum literal belonging to the given wrapper class (or null).
static EJavaPrimitive getPrimitive(java.lang.String name)
          Get primitive by name.
static EJavaPrimitive getPrimitiveIgnoreCase(java.lang.String name)
          Get primitive by name ignoring case.
 java.lang.Class<?> getWrapperClass()
          Returns the wrapper class for the primitive.
static boolean isWrapperType(java.lang.Class<?> clazz)
          Returns whether the given class is a wrapper type for a primitive.
static EJavaPrimitive valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EJavaPrimitive[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VOID

public static final EJavaPrimitive VOID
void


BYTE

public static final EJavaPrimitive BYTE
byte


CHAR

public static final EJavaPrimitive CHAR
char


DOUBLE

public static final EJavaPrimitive DOUBLE
double


FLOAT

public static final EJavaPrimitive FLOAT
float


INT

public static final EJavaPrimitive INT
int


LONG

public static final EJavaPrimitive LONG
long


SHORT

public static final EJavaPrimitive SHORT
short


BOOLEAN

public static final EJavaPrimitive BOOLEAN
boolean

Method Detail

values

public static EJavaPrimitive[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EJavaPrimitive c : EJavaPrimitive.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EJavaPrimitive valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getClassObject

public java.lang.Class<?> getClassObject()
Get the class object of the primitive.


getWrapperClass

public java.lang.Class<?> getWrapperClass()
Returns the wrapper class for the primitive.


getPrimitive

public static EJavaPrimitive getPrimitive(java.lang.String name)
Get primitive by name.

Returns:
primitive or null if unknown primitive was requested

getPrimitiveIgnoreCase

public static EJavaPrimitive getPrimitiveIgnoreCase(java.lang.String name)
Get primitive by name ignoring case.

Returns:
primitive or null if unknown primitive was requested

getForPrimitiveClass

public static EJavaPrimitive getForPrimitiveClass(java.lang.Class<?> clazz)
Returns the enum literal belonging to the given primitive class (or null).


getForWrapperClass

public static EJavaPrimitive getForWrapperClass(java.lang.Class<?> clazz)
Returns the enum literal belonging to the given wrapper class (or null).


getForPrimitiveOrWrapperClass

public static EJavaPrimitive getForPrimitiveOrWrapperClass(java.lang.Class<?> clazz)
Returns the enum literal belonging to the given primitive or wrapper class (or null).


isWrapperType

public static boolean isWrapperType(java.lang.Class<?> clazz)
Returns whether the given class is a wrapper type for a primitive.


TUM CCSM Commons

TUM CCSM Commons - 2.7