Java Utililty Methods Reflection Primitive

List of utility methods to do Reflection Primitive

Description

The list of methods to do Reflection Primitive are organized into topic(s).

Method

StringgetBENameByPrimitiveClassName(String implementClassName)
Get the entity name of class
return (String) primitiveBEMap.get(implementClassName);
ObjectgetDefaultPrimitiveValue(Class clazz)
<#if locale="en">

Get default value if the Class is primitive type.

if (clazz == null || !clazz.isPrimitive()) {
    return null;
return primitiveToDefaultValueMap.get(clazz);
ObjectgetDefaultValue(Class primitive)
get Default Value
return defaultPrimitiveValues.get(primitive);
ObjectgetDefaultValueForPrimitive(Class type)
get Default Value For Primitive
return primitiveToDefault.get(type);
ObjectgetNullOrPrimitiveDefault(Class to)
get Null Or Primitive Default
return primitiveDefaults.get(to); 
ClassgetPrimitive(final String classname)
Returns the primitive Class object if the specified class name represents a primitive type; otherwise, returns null
return TYPE_MAP.get(classname);
ClassgetPrimitiveClass(Class wrapper)
get Primitive Class
if (wrapper == Integer.class)
    return int.class;
else if (wrapper == Short.class)
    return short.class;
else if (wrapper == Boolean.class)
    return boolean.class;
else if (wrapper == Byte.class)
    return byte.class;
...
ClassgetPrimitiveClass(Class wrapperClazz)
get Primitive Class
if (isPrimitiveWrapperClass(wrapperClazz)) {
    return getPrimitiveClass(wrapperClasses.get(wrapperClazz.getName()));
return null;
ClassgetPrimitiveClass(Class boxedClass)

Return the primitive counterpart class for the given boxed type.

return (Class<T>) primitiveCounterparts.get(boxedClass);
ClassgetPrimitiveClass(String name)
Returns the primitive class object that matches the specified type name.
Returns null if the name does not match a primitive type.
return (Class) primitiveClasses.get(name);