Enum PrimitiveTypeConverter
- java.lang.Object
- 
- java.lang.Enum<PrimitiveTypeConverter>
- 
- org.bytemechanics.commons.reflection.PrimitiveTypeConverter
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<PrimitiveTypeConverter>
 
 public enum PrimitiveTypeConverter extends Enum<PrimitiveTypeConverter> This enumerated allows to convert primitive types to it's corresponding class type int - Integer, float - Float... Usage: Class objectClass=PrimitiveTypeConverter.convert(primitiveClass)- Since:
- 1.3.0
- Author:
- afarre
 
- 
- 
Field SummaryFields Modifier and Type Field Description ClassobjectClassClassprimitiveClass
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static Classconvert(Class _primitiveClass)Try to convert primitive types to it's corresponding class type if are primitivesstatic PrimitiveTypeConvertervalueOf(String name)Returns the enum constant of this type with the specified name.static PrimitiveTypeConverter[]values()Returns an array containing the constants of this enum type, in the order they are declared.
 
- 
- 
- 
Enum Constant Detail- 
VOIDpublic static final PrimitiveTypeConverter VOID 
 - 
BYTEpublic static final PrimitiveTypeConverter BYTE 
 - 
BOOLEANpublic static final PrimitiveTypeConverter BOOLEAN 
 - 
INTEGERpublic static final PrimitiveTypeConverter INTEGER 
 - 
SHORTpublic static final PrimitiveTypeConverter SHORT 
 - 
LONGpublic static final PrimitiveTypeConverter LONG 
 - 
FLOATpublic static final PrimitiveTypeConverter FLOAT 
 - 
DOUBLEpublic static final PrimitiveTypeConverter DOUBLE 
 - 
CHARpublic static final PrimitiveTypeConverter CHAR 
 
- 
 - 
Method Detail- 
valuespublic static PrimitiveTypeConverter[] 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 (PrimitiveTypeConverter c : PrimitiveTypeConverter.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static PrimitiveTypeConverter valueOf(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:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
 - 
convertpublic static final Class convert(Class _primitiveClass) Try to convert primitive types to it's corresponding class type if are primitives- Parameters:
- _primitiveClass- primitive to convert
- Returns:
- it's corresponding primitive class or the same class if it's not primitive
- Throws:
- NullPointerException- if the class provided is null
 
 
- 
 
-