final class Types
extends java.lang.Object
Type.| Modifier and Type | Class and Description |
|---|---|
private static class |
Types.ClassOwnership
Decides what owner type to use for constructing
ParameterizedType from a raw class. |
private static class |
Types.GenericArrayTypeImpl |
(package private) static class |
Types.JavaVersion |
(package private) static class |
Types.NativeTypeVariableEquals<X>
Per https://code.google.com/p/guava-libraries/issues/detail?id=1635, In JDK 1.7.0_51-b13,
TypeVariableImpl.equals() is changed to no longer be equal to custom TypeVariable
implementations.
|
private static class |
Types.ParameterizedTypeImpl |
private static class |
Types.TypeVariableImpl<D extends java.lang.reflect.GenericDeclaration> |
private static class |
Types.TypeVariableInvocationHandler
Invocation handler to work around a compatibility problem between Java 7 and Java 8.
|
(package private) static class |
Types.WildcardTypeImpl |
| Modifier and Type | Field and Description |
|---|---|
private static Joiner |
COMMA_JOINER |
private static Function<java.lang.reflect.Type,java.lang.String> |
TYPE_NAME
Class#toString without the "class " and "interface " prefixes
|
| Modifier | Constructor and Description |
|---|---|
private |
Types() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
disallowPrimitiveType(java.lang.reflect.Type[] types,
java.lang.String usedAs) |
private static java.lang.Iterable<java.lang.reflect.Type> |
filterUpperBounds(java.lang.Iterable<java.lang.reflect.Type> bounds) |
(package private) static java.lang.Class<?> |
getArrayClass(java.lang.Class<?> componentType)
Returns the
Class object of arrays with componentType. |
(package private) static java.lang.reflect.Type |
getComponentType(java.lang.reflect.Type type) |
(package private) static java.lang.reflect.Type |
newArrayType(java.lang.reflect.Type componentType)
Returns the array type of
componentType. |
(package private) static <D extends java.lang.reflect.GenericDeclaration> |
newArtificialTypeVariable(D declaration,
java.lang.String name,
java.lang.reflect.Type... bounds)
Returns a new
TypeVariable that belongs to declaration with name and
bounds. |
(package private) static java.lang.reflect.ParameterizedType |
newParameterizedType(java.lang.Class<?> rawType,
java.lang.reflect.Type... arguments)
Returns a type where
rawType is parameterized by arguments. |
(package private) static java.lang.reflect.ParameterizedType |
newParameterizedTypeWithOwner(java.lang.reflect.Type ownerType,
java.lang.Class<?> rawType,
java.lang.reflect.Type... arguments)
Returns a type where
rawType is parameterized by arguments and is owned by
ownerType. |
private static <D extends java.lang.reflect.GenericDeclaration> |
newTypeVariableImpl(D genericDeclaration,
java.lang.String name,
java.lang.reflect.Type[] bounds) |
(package private) static java.lang.reflect.WildcardType |
subtypeOf(java.lang.reflect.Type upperBound)
Returns a new
WildcardType with upperBound. |
private static java.lang.reflect.Type |
subtypeOfComponentType(java.lang.reflect.Type[] bounds)
Returns
? extends X if any of bounds is a subtype of X[]; or null
otherwise. |
(package private) static java.lang.reflect.WildcardType |
supertypeOf(java.lang.reflect.Type lowerBound)
Returns a new
WildcardType with lowerBound. |
private static java.lang.reflect.Type[] |
toArray(java.util.Collection<java.lang.reflect.Type> types) |
(package private) static java.lang.String |
toString(java.lang.reflect.Type type)
Returns human readable string representation of
type. |
private static final Function<java.lang.reflect.Type,java.lang.String> TYPE_NAME
private static final Joiner COMMA_JOINER
static java.lang.reflect.Type newArrayType(java.lang.reflect.Type componentType)
componentType.static java.lang.reflect.ParameterizedType newParameterizedTypeWithOwner(@Nullable
java.lang.reflect.Type ownerType,
java.lang.Class<?> rawType,
java.lang.reflect.Type... arguments)
rawType is parameterized by arguments and is owned by
ownerType.static java.lang.reflect.ParameterizedType newParameterizedType(java.lang.Class<?> rawType,
java.lang.reflect.Type... arguments)
rawType is parameterized by arguments.static <D extends java.lang.reflect.GenericDeclaration> java.lang.reflect.TypeVariable<D> newArtificialTypeVariable(D declaration,
java.lang.String name,
java.lang.reflect.Type... bounds)
TypeVariable that belongs to declaration with name and
bounds.static java.lang.reflect.WildcardType subtypeOf(java.lang.reflect.Type upperBound)
WildcardType with upperBound.static java.lang.reflect.WildcardType supertypeOf(java.lang.reflect.Type lowerBound)
WildcardType with lowerBound.static java.lang.String toString(java.lang.reflect.Type type)
type.
Foo[], "com.mypackage.Foo[]" are returned.
theClass.getName() are returned.
type.toString() are returned.
@Nullable static java.lang.reflect.Type getComponentType(java.lang.reflect.Type type)
@Nullable private static java.lang.reflect.Type subtypeOfComponentType(java.lang.reflect.Type[] bounds)
? extends X if any of bounds is a subtype of X[]; or null
otherwise.private static <D extends java.lang.reflect.GenericDeclaration> java.lang.reflect.TypeVariable<D> newTypeVariableImpl(D genericDeclaration,
java.lang.String name,
java.lang.reflect.Type[] bounds)
private static java.lang.reflect.Type[] toArray(java.util.Collection<java.lang.reflect.Type> types)
private static java.lang.Iterable<java.lang.reflect.Type> filterUpperBounds(java.lang.Iterable<java.lang.reflect.Type> bounds)
private static void disallowPrimitiveType(java.lang.reflect.Type[] types,
java.lang.String usedAs)
static java.lang.Class<?> getArrayClass(java.lang.Class<?> componentType)
Class object of arrays with componentType.