org.modelmapper.internal.util
Class Primitives

java.lang.Object
  extended by org.modelmapper.internal.util.Primitives

public final class Primitives
extends Object

Utility methods for working with primitives.

Author:
Jonathan Halterman

Method Summary
static Object defaultValue(Class<?> type)
          Returns the default value for type if type is a primitive, else null.
static boolean isPrimitive(Class<?> type)
          Returns true if type is a primitive or a primitive wrapper.
static boolean isPrimitiveWrapper(Class<?> type)
          Returns true if type is a primitive wrapper.
static Class<?> wrapperFor(Class<?> type)
          Returns the primitive wrapper for type, else returns type if type is not a primitive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

defaultValue

public static Object defaultValue(Class<?> type)
Returns the default value for type if type is a primitive, else null.


isPrimitive

public static boolean isPrimitive(Class<?> type)
Returns true if type is a primitive or a primitive wrapper.


wrapperFor

public static Class<?> wrapperFor(Class<?> type)
Returns the primitive wrapper for type, else returns type if type is not a primitive.


isPrimitiveWrapper

public static boolean isPrimitiveWrapper(Class<?> type)
Returns true if type is a primitive wrapper.



Copyright © 2011. All Rights Reserved.