public final class TypeHelper extends Object
Modifier and Type | Method and Description |
---|---|
static GenericArrayType |
genericArrayType(Type componentType)
Creates a generic array type for the specified component type.
|
static Type |
getArrayType(Type componentType) |
static Type |
getComponentType(Type type) |
static Type |
getErasedType(Type type)
Gets the erased type of the specified type.
|
static Type[] |
getResolvedInterfaces(Type type) |
static <T extends Annotation> |
getValidatorsTypes(List<Class<? extends ConstraintValidator<T,?>>> validators) |
static boolean |
isArray(Type type) |
static boolean |
isAssignable(Type supertype,
Type type) |
static boolean |
isInstance(Type type,
Object object) |
static ParameterizedType |
parameterizedType(Class<?> rawType,
Type... actualTypeArguments)
Creates a parameterized type for the specified raw type and actual type arguments.
|
public static Type getErasedType(Type type)
type
- the type to perform erasure onpublic static boolean isArray(Type type)
public static GenericArrayType genericArrayType(Type componentType)
componentType
- the component typepublic static ParameterizedType parameterizedType(Class<?> rawType, Type... actualTypeArguments)
rawType
- the raw typeactualTypeArguments
- the actual type argumentsMalformedParameterizedTypeException
- if the number of actual type arguments differs from those defined on the raw typepublic static <T extends Annotation> Map<Type,Class<? extends ConstraintValidator<?,?>>> getValidatorsTypes(List<Class<? extends ConstraintValidator<T,?>>> validators)
validators
- List of constraint validator classes (for a given constraint).Copyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved