|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ClassType>
com.mymed.utils.ClassType
public enum ClassType
Enum type to store information about the class types. Information are stored
as <Class, Primitive type>; for an int
it is: <Integer,
int>.
String
is stored as <String, String>.
Enum Constant Summary | |
---|---|
BOOL
|
|
BYTE
|
|
CHAR
|
|
DOUBLE
|
|
FLOAT
|
|
INT
|
|
LONG
|
|
STRING
|
Method Summary | |
---|---|
java.lang.Class<?> |
getObjectClass()
|
java.lang.Class<?> |
getPrimitiveType()
|
static ClassType |
inferTpye(java.lang.Class<?> classType)
Infer the class type of the given, unknown, class |
static ClassType |
inferType(java.lang.Object object)
Infer the class type of the given Object |
static ClassType |
inferType(java.lang.reflect.Type type)
Infer the class type of the given, unknown, class |
static java.lang.Object |
objectFromClassType(ClassType classType,
byte[] arg)
Create an abject of the specified ClassType type |
static byte[] |
objectToByteArray(ClassType classType,
java.lang.Object object)
Convert an object of the specified ClassType into a byte array |
java.lang.String |
toString()
|
static ClassType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static ClassType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final ClassType BYTE
public static final ClassType BOOL
public static final ClassType CHAR
public static final ClassType DOUBLE
public static final ClassType FLOAT
public static final ClassType INT
public static final ClassType LONG
public static final ClassType STRING
Method Detail |
---|
public static ClassType[] values()
for (ClassType c : ClassType.values()) System.out.println(c);
public static ClassType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic java.lang.Class<?> getObjectClass()
public java.lang.Class<?> getPrimitiveType()
public static ClassType inferType(java.lang.Object object)
Object
object
- the Object
to infer the Class
of
public static ClassType inferTpye(java.lang.Class<?> classType)
classType
- the class to infer its Class
public static ClassType inferType(java.lang.reflect.Type type)
type
- the type to infer its Class
public static java.lang.Object objectFromClassType(ClassType classType, byte[] arg)
classType
- the type of the object to createarg
- the byte array with the value of the object to create
public static byte[] objectToByteArray(ClassType classType, java.lang.Object object)
classType
- the ClassType with the type of the objectobject
- the object to convert
public java.lang.String toString()
toString
in class java.lang.Enum<ClassType>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |