List of utility methods to do Reflection Primitive
boolean | isPrimitiveWrapper(Class> klass) Determines if klass represents a wrapper for a primitive type. return PRIMITIVE_WRAPPERS.containsValue(klass);
|
boolean | isPrimitiveWrapper(final Class> type) Returns whether the given type is a primitive wrapper ( Boolean , Byte , Character , Short , Integer , Long , Double , Float ). return wrapperPrimitiveMap.containsKey(type);
|
boolean | isPrimitiveWrapperArray(Class clazz) Check if the given class represents an array of primitive wrappers, i.e. if (clazz == null) throw new IllegalArgumentException("Class must not be null"); return (clazz.isArray() && isPrimitiveWrapper(clazz.getComponentType())); |
boolean | isPrimitiveWrapperClass(Class primitiveWrapperClass) is Primitive Wrapper Class return primitiveStringToClass.values().contains(primitiveWrapperClass);
|
boolean | isWrapper(Class> clazz) Returns information whether the given class is the wrapper class. return wrappers.contains(clazz);
|
boolean | isWrapper(Class> dataType) is Wrapper return wrapperClassesMap().containsKey(dataType);
|
boolean | isWrapperAndPrimitivePair(Class> c1, Class> c2) is Wrapper And Primitive Pair if (c1 == null || c2 == null) { return false; if (c1.isPrimitive()) { return PRIMITIVES_TO_WRAPPERS.get(c1).equals(c2); } else if (c2.isPrimitive()) { return PRIMITIVES_TO_WRAPPERS.get(c2).equals(c1); return false; |
boolean | isWrapperClass(Class> clazz) is Wrapper Class return primitiveMap.values().contains(clazz);
|
boolean | isWrapperType(Class> type) is Wrapper Type return WRAPPER_TYPES.contains(type);
|
int | matchPrimitive(Class> paramType, Object arg) Attempts to match the argument value against the passed primitive type. Class<?> argType = getPrimitiveType(arg); if (argType == null) return -1; if (paramType == argType) return 1; if (integralDistance.containsKey(argType) && integralDistance.containsKey(paramType)) { int argDepth = integralDistance.get(argType).intValue(); int paramDepth = integralDistance.get(paramType).intValue(); ... |