public class Types
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.function.Function<java.lang.reflect.Type,java.lang.Class<?>> |
TYPE_TO_CLASS_FUNCTION |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Class<?> |
boxedClass(java.lang.Class<?> type) |
static java.lang.reflect.Type |
boxedType(java.lang.reflect.Type type)
Gets the boxed type of a class
|
static <C extends java.lang.Class<?>> |
buildClassNameMap(java.lang.Iterable<C> set)
Builds (class name -> class) map for given classes.
|
static boolean |
containsUnresolvedTypeVariableOrWildcard(java.lang.reflect.Type type) |
static java.lang.reflect.Type |
getArrayComponentType(java.lang.reflect.Type type)
Determines the component type for a given array type.
|
static java.lang.reflect.Type |
getCanonicalType(java.lang.Class<?> clazz)
Returns a canonical type for a given class.
|
static java.lang.reflect.Type |
getCanonicalType(java.lang.reflect.Type type) |
static java.util.Set<java.lang.Class<?>> |
getRawTypes(java.util.Set<java.lang.reflect.Type> types) |
static java.lang.Class<?>[] |
getRawTypes(java.lang.reflect.Type[] types) |
static java.lang.String |
getTypeId(java.lang.reflect.Type type) |
static boolean |
isActualType(java.lang.reflect.Type type)
Determines whether the given type is an actual type.
|
static boolean |
isArray(java.lang.reflect.Type type)
Determines whether the given type is an array type.
|
static boolean |
isArrayOfUnboundedTypeVariablesOrObjects(java.lang.reflect.Type[] types)
Determines whether the given array only contains unbounded type variables or Object.class.
|
static boolean |
isRawGenericType(java.lang.reflect.Type type) |
public static final java.util.function.Function<java.lang.reflect.Type,java.lang.Class<?>> TYPE_TO_CLASS_FUNCTION
public static java.lang.reflect.Type boxedType(java.lang.reflect.Type type)
type - The typepublic static java.lang.Class<?> boxedClass(java.lang.Class<?> type)
public static java.lang.String getTypeId(java.lang.reflect.Type type)
public static java.lang.reflect.Type getCanonicalType(java.lang.Class<?> clazz)
ParameterizedType (with unresolved type
variables) is resolved.
If the class is an array then the component type of the array is canonicalized
Otherwise, the class is returned.public static java.lang.reflect.Type getCanonicalType(java.lang.reflect.Type type)
type - public static boolean containsUnresolvedTypeVariableOrWildcard(java.lang.reflect.Type type)
public static java.util.Set<java.lang.Class<?>> getRawTypes(java.util.Set<java.lang.reflect.Type> types)
public static java.lang.Class<?>[] getRawTypes(java.lang.reflect.Type[] types)
public static <C extends java.lang.Class<?>> java.util.Map<java.lang.String,C> buildClassNameMap(java.lang.Iterable<C> set)
public static boolean isActualType(java.lang.reflect.Type type)
type - the given typepublic static boolean isArray(java.lang.reflect.Type type)
type - the given typepublic static java.lang.reflect.Type getArrayComponentType(java.lang.reflect.Type type)
type - the given array typepublic static boolean isArrayOfUnboundedTypeVariablesOrObjects(java.lang.reflect.Type[] types)
types - the given array of typespublic static boolean isRawGenericType(java.lang.reflect.Type type)
Copyright © 2014. All Rights Reserved.