ma.glasnost.orika.impl.util
Class ClassUtil

java.lang.Object
  extended by ma.glasnost.orika.impl.util.ClassUtil

public final class ClassUtil
extends Object


Method Summary
static Class<?> getPrimitiveType(Class<?> wrapperType)
          Returns the corresponding primitive type for the given primitive wrapper, or null if the type is not a primitive wrapper.
static Class<?> getWrapperType(Class<?> primitiveType)
          Returns the corresponding wrapper type for the given primitive, or null if the type is not primitive.
static boolean isConcrete(Class<?> type)
          Verifies whether a given type is non-abstract and not an interface.
static boolean isConcrete(Type<?> type)
          Verifies whether a given type is non-abstract and not an interface.
static boolean isConvertibleFromString(Class<?> type)
          Verifies whether the passed type has a static valueOf method available for converting a String into an instance of the type.
Note that this method will also return true for primitive types whose corresponding wrapper types have a static valueOf method.
static boolean isImmutable(Class<?> clazz)
           
static boolean isImmutable(Type<?> type)
           
static boolean isPrimitiveWrapper(Class<?> type)
          Verifies whether a given type is one of the wrapper classes for a primitive type.
static boolean isProxy(Class<?> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isImmutable

public static boolean isImmutable(Class<?> clazz)

isImmutable

public static boolean isImmutable(Type<?> type)

isConcrete

public static boolean isConcrete(Class<?> type)
Verifies whether a given type is non-abstract and not an interface.

Parameters:
type -
Returns:
true if the passed type is not abstract and not an interface; false otherwise.

isConcrete

public static boolean isConcrete(Type<?> type)
Verifies whether a given type is non-abstract and not an interface.

Parameters:
type -
Returns:
true if the passed type is not abstract and not an interface; false otherwise.

isPrimitiveWrapper

public static boolean isPrimitiveWrapper(Class<?> type)
Verifies whether a given type is one of the wrapper classes for a primitive type.

Parameters:
type -
Returns:

isConvertibleFromString

public static boolean isConvertibleFromString(Class<?> type)
Verifies whether the passed type has a static valueOf method available for converting a String into an instance of the type.
Note that this method will also return true for primitive types whose corresponding wrapper types have a static valueOf method.

Parameters:
type -
Returns:

getWrapperType

public static Class<?> getWrapperType(Class<?> primitiveType)
Returns the corresponding wrapper type for the given primitive, or null if the type is not primitive.

Parameters:
primitiveType -
Returns:

getPrimitiveType

public static Class<?> getPrimitiveType(Class<?> wrapperType)
Returns the corresponding primitive type for the given primitive wrapper, or null if the type is not a primitive wrapper.

Parameters:
wrapperType -
Returns:
the corresponding primitive type

isProxy

public static boolean isProxy(Class<?> clazz)


Copyright © 2013 Glasnost. All Rights Reserved.