org.spicefactory.cinnamon.reflect.util
Class GenericsUtil

java.lang.Object
  extended by org.spicefactory.cinnamon.reflect.util.GenericsUtil

public class GenericsUtil
extends Object

Static utility methods dealing with reflection on generic types.

Author:
Jens Halm

Constructor Summary
GenericsUtil()
           
 
Method Summary
static Class<?> getRawType(Type type)
          Returns the raw type of the given generic type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericsUtil

public GenericsUtil()
Method Detail

getRawType

public static Class<?> getRawType(Type type)
Returns the raw type of the given generic type. Instances of Class will be returned unchanged. For instances of ParameterizedType the raw type will be returned. For instances of TypeVariable the raw type of the first bound will be returned. For instances of GenericArrayType a Class representing an Array of the raw component type of the GenericArrayType will be returned. This method is not applicable for instances of WildcardType.

Parameters:
type - the type for which the raw type should be returned
Returns:
the raw type for the given generic type