Java Reflection Primitive getNullOrPrimitiveDefault(Class to)

Here you can find the source of getNullOrPrimitiveDefault(Class to)

Description

get Null Or Primitive Default

License

Open Source License

Declaration

public static Object getNullOrPrimitiveDefault(Class<?> to) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;

public class Main {
    static HashMap<Class<?>, Object> primitiveDefaults = new HashMap<Class<?>, Object>();

    public static Object getNullOrPrimitiveDefault(Class<?> to) {
        return primitiveDefaults.get(to); // If not a primitive, will return null
    }/*from  w  w  w .jav  a  2  s .  c om*/
}

Related

  1. createDefaultPrimitive(Class type)
  2. getBENameByPrimitiveClassName( String implementClassName)
  3. getDefaultPrimitiveValue(Class clazz)
  4. getDefaultValue(Class primitive)
  5. getDefaultValueForPrimitive(Class type)
  6. getPrimitive(final String classname)
  7. getPrimitiveClass(Class wrapper)
  8. getPrimitiveClass(Class wrapperClazz)
  9. getPrimitiveClass(Class boxedClass)