Package org.openxava.util
Class Primitives
- java.lang.Object
-
- org.openxava.util.Primitives
-
public class Primitives extends java.lang.Object
Utilities to work with Java primitive data.Primitive types are
boolean, byte, char, short, int, long, float
anddouble
.- Author:
- Javier Paniza
-
-
Constructor Summary
Constructors Constructor Description Primitives()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class
classForName(java.lang.String type)
Class for name, but supporting primitive types and arrays of primitive types.static java.lang.Class
toPrimitiveClass(java.lang.Class origin)
Primitive class corresponding to class of wrapper class sent.static java.lang.Class
toWrapperClass(java.lang.Class origin)
Wrapper class corresponding to class of primitive sent.
-
-
-
Method Detail
-
toWrapperClass
public static java.lang.Class toWrapperClass(java.lang.Class origin)
Wrapper class corresponding to class of primitive sent.That is, if it receive a
int.class
then returns aInteger.class
.If receives a class of a no primitive class then returns the same class.
If receives null returns null.
-
classForName
public static java.lang.Class classForName(java.lang.String type) throws java.lang.ClassNotFoundException
Class for name, but supporting primitive types and arrays of primitive types.If receives null returns null.
- Throws:
java.lang.ClassNotFoundException
-
toPrimitiveClass
public static java.lang.Class toPrimitiveClass(java.lang.Class origin)
Primitive class corresponding to class of wrapper class sent.That is, if it receive a
Integer.class
then returns aint.class
.If receives a class of a no primitive wrapper class then returns the same class.
If receives null returns null.
-
-