Package com.google.common.reflect
Class Types
java.lang.Object
com.google.common.reflect.Types
Utilities for working with
Type.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enumDecides what owner type to use for constructingParameterizedTypefrom a raw class.private static final class(package private) static enum(package private) static final classPer issue 1635, In JDK 1.7.0_51-b13,Types.TypeVariableImpl.equals(Object)is changed to no longer be equal to custom TypeVariable implementations.private static final classprivate static final classTypes.TypeVariableImpl<D extends GenericDeclaration>private static final classInvocation handler to work around a compatibility problem between Java 7 and Java 8.(package private) static final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddisallowPrimitiveType(Type[] types, String usedAs) filterUpperBounds(Iterable<Type> bounds) (package private) static Class<?>getArrayClass(Class<?> componentType) Returns theClassobject of arrays withcomponentType.(package private) static TypegetComponentType(Type type) (package private) static TypenewArrayType(Type componentType) Returns the array type ofcomponentType.(package private) static <D extends GenericDeclaration>
TypeVariable<D>newArtificialTypeVariable(D declaration, String name, Type... bounds) (package private) static ParameterizedTypenewParameterizedType(Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byarguments.(package private) static ParameterizedTypenewParameterizedTypeWithOwner(Type ownerType, Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byargumentsand is owned byownerType.private static <D extends GenericDeclaration>
TypeVariable<D>newTypeVariableImpl(D genericDeclaration, String name, Type[] bounds) (package private) static WildcardTypeReturns a newWildcardTypewithupperBound.private static TypesubtypeOfComponentType(Type[] bounds) Returns? extends Xif any ofboundsis a subtype ofX[]; or null otherwise.(package private) static WildcardTypesupertypeOf(Type lowerBound) Returns a newWildcardTypewithlowerBound.private static Type[]toArray(Collection<Type> types) (package private) static StringReturns human readable string representation oftype.
-
Field Details
-
TYPE_NAME
Class#toString without the "class " and "interface " prefixes -
COMMA_JOINER
-
-
Constructor Details
-
Types
private Types()
-
-
Method Details
-
newArrayType
Returns the array type ofcomponentType. -
newParameterizedTypeWithOwner
static ParameterizedType newParameterizedTypeWithOwner(@CheckForNull Type ownerType, Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byargumentsand is owned byownerType. -
newParameterizedType
Returns a type whererawTypeis parameterized byarguments. -
newArtificialTypeVariable
static <D extends GenericDeclaration> TypeVariable<D> newArtificialTypeVariable(D declaration, String name, Type... bounds) -
subtypeOf
Returns a newWildcardTypewithupperBound. -
supertypeOf
Returns a newWildcardTypewithlowerBound. -
toString
Returns human readable string representation oftype.The format is subject to change.
-
getComponentType
-
subtypeOfComponentType
Returns? extends Xif any ofboundsis a subtype ofX[]; or null otherwise. -
newTypeVariableImpl
private static <D extends GenericDeclaration> TypeVariable<D> newTypeVariableImpl(D genericDeclaration, String name, Type[] bounds) -
toArray
-
filterUpperBounds
-
disallowPrimitiveType
-
getArrayClass
Returns theClassobject of arrays withcomponentType.
-