Uses of Class
com.google.common.reflect.TypeToken
Packages that use TypeToken
Package
Description
Utilities for reflection.
Testing utilities.
-
Uses of TypeToken in com.google.common.reflect
Subclasses of TypeToken in com.google.common.reflectFields in com.google.common.reflect declared as TypeTokenFields in com.google.common.reflect with type parameters of type TypeTokenModifier and TypeFieldDescriptionMutableTypeToInstanceMap.backingMapprivate ImmutableSet<TypeToken<? super T>> TypeToken.ClassSet.classesprivate final ImmutableMap<TypeToken<? extends B>, B> ImmutableTypeToInstanceMap.delegate(package private) static final TypeToken.TypeCollector<TypeToken<?>> TypeToken.TypeCollector.FOR_GENERIC_TYPEprivate ImmutableSet<TypeToken<? super T>> TypeToken.InterfaceSet.interfacesprivate final ImmutableMap.Builder<TypeToken<? extends B>, B> ImmutableTypeToInstanceMap.Builder.mapBuilderprivate ImmutableSet<TypeToken<? super T>> TypeToken.TypeSet.typesMethods in com.google.common.reflect that return TypeTokenModifier and TypeMethodDescriptionTypeToken.boundAsSuperclass(Type bound) TypeToken.getArraySubtype(Class<?> subclass) TypeToken.getArraySupertype(Class<? super T> supertype) final TypeToken<?> TypeToken.getComponentType()Returns the array component type if this type represents an array (int[],T[],<? extends Map<String, Integer>[]>etc.), or elsenullis returned.TypeToken.getGenericSuperclass()Returns the generic superclass of this type ornullif the type representsObjector an interface.Invokable.getOwnerType()Returns the type ofT.Invokable.getReturnType()Returns the return type of thisInvokable.TypeToken.getSubtype(Class<?> subclass) Returns subtype ofthiswithsubclassas the raw class.TypeToken.getSubtypeFromLowerBounds(Class<?> subclass, Type[] lowerBounds) TypeToken.getSupertype(Class<? super T> superclass) Returns the generic form ofsuperclass.TypeToken.getSupertypeFromUpperBounds(Class<? super T> supertype, Type[] upperBounds) TypeToken<?> Parameter.getType()Returns the type of the parameter.static <T> TypeToken<T> Returns an instance of type token that wrapstype.static TypeToken<?> Returns an instance of type token that wrapstype.TypeToken.rejectTypeVariables()Ensures that this type token doesn't contain type variables, which can cause unchecked type errors for callers likeTypeToInstanceMap.private TypeToken<?> TypeToken.resolveSupertype(Type type) final TypeToken<?> TypeToken.resolveType(Type type) Resolves the giventypeagainst the type context represented by this type.(package private) static <T> TypeToken<? extends T> TypeToken.toGenericType(Class<T> cls) Returns the type token representing the generic type declaration ofcls.TypeToken.unwrap()Returns the corresponding primitive type if this is a wrapper type; otherwise returnsthisitself.TypeToken.where(TypeParameter<X> typeParam, TypeToken<X> typeArg) Returns a newTypeTokenwhere type variables represented bytypeParamare substituted bytypeArg.TypeToken.where(TypeParameter<X> typeParam, Class<X> typeArg) Returns a newTypeTokenwhere type variables represented bytypeParamare substituted bytypeArg.TypeToken.wrap()Returns the corresponding wrapper type if this is a primitive type; otherwise returnsthisitself.Methods in com.google.common.reflect that return types with arguments of type TypeTokenModifier and TypeMethodDescriptionprivate ImmutableList<TypeToken<? super T>> TypeToken.boundsAsInterfaces(Type[] bounds) ImmutableTypeToInstanceMap.delegate()MutableTypeToInstanceMap.delegate()TypeToken.ClassSet.delegate()TypeToken.InterfaceSet.delegate()TypeToken.TypeSet.delegate()MutableTypeToInstanceMap.entrySet()final ImmutableList<TypeToken<? extends Throwable>> Invokable.getExceptionTypes()Returns all declared exception types of thisInvokable.(package private) final ImmutableList<TypeToken<? super T>> TypeToken.getGenericInterfaces()Returns the generic interfaces that this type directlyimplements.Methods in com.google.common.reflect with parameters of type TypeTokenModifier and TypeMethodDescription<T extends B>
TImmutableTypeToInstanceMap.getInstance(TypeToken<T> type) <T extends B>
TMutableTypeToInstanceMap.getInstance(TypeToken<T> type) <T extends B>
TTypeToInstanceMap.getInstance(TypeToken<T> type) Returns the value the specified type is mapped to, ornullif no entry for this type is present.final booleanTypeToken.isSubtypeOf(TypeToken<?> type) Returns true if this type is a subtype of the giventype.final booleanTypeToken.isSupertypeOf(TypeToken<?> type) Returns true if this type is a supertype of the giventype.<T extends B>
ImmutableTypeToInstanceMap.Builder<B> Associateskeywithvaluein the built map.Deprecated.unsupported operationDeprecated.unsupported operation<T extends B>
TImmutableTypeToInstanceMap.putInstance(TypeToken<T> type, T value) Deprecated.unsupported operation<T extends B>
TMutableTypeToInstanceMap.putInstance(TypeToken<T> type, T value) <T extends B>
TTypeToInstanceMap.putInstance(TypeToken<T> type, T value) Maps the specified type to the specified value.Explicitly specifies the return type of thisInvokable.private <T extends B>
TImmutableTypeToInstanceMap.trustedGet(TypeToken<T> type) private <T extends B>
TMutableTypeToInstanceMap.trustedGet(TypeToken<T> type) private <T extends B>
TMutableTypeToInstanceMap.trustedPut(TypeToken<T> type, T value) TypeToken.where(TypeParameter<X> typeParam, TypeToken<X> typeArg) Returns a newTypeTokenwhere type variables represented bytypeParamare substituted bytypeArg.Method parameters in com.google.common.reflect with type arguments of type TypeTokenModifier and TypeMethodDescriptionvoidDeprecated.unsupported operationvoidDeprecated.unsupported operationConstructors in com.google.common.reflect with parameters of type TypeTokenModifierConstructorDescription(package private)Parameter(Invokable<?, ?> declaration, int position, TypeToken<?> type, Annotation[] annotations, Object annotatedType) Constructor parameters in com.google.common.reflect with type arguments of type TypeTokenModifierConstructorDescriptionprivateImmutableTypeToInstanceMap(ImmutableMap<TypeToken<? extends B>, B> delegate) -
Uses of TypeToken in com.google.common.testing
Fields in com.google.common.testing declared as TypeTokenModifier and TypeFieldDescriptionprivate final TypeToken<?> DummyProxy.DummyHandler.interfaceTypeMethods in com.google.common.testing that return TypeTokenModifier and TypeMethodDescription(package private) TypeToken<?> FreshValueGenerator.generateTypeToken()private static TypeToken<?> NullPointerTester.getFirstTypeParameter(Type type) Methods in com.google.common.testing with parameters of type TypeTokenModifier and TypeMethodDescriptionprivate <F,T> Converter <F, T> NullPointerTester.defaultConverter(TypeToken<F> convertFromType, TypeToken<T> convertToType) (package private) <R> RClassSanityTester.SerializableDummyProxy.dummyReturnValue(TypeToken<R> returnType) (package private) abstract <R> RDummyProxy.dummyReturnValue(TypeToken<R> returnType) Returns the dummy return value forreturnType.private ObjectGenerates an instance fortypeusing the currentFreshValueGenerator.freshness.(package private) final ObjectFreshValueGenerator.generateFresh(TypeToken<?> type) Returns a fresh instance fortypeif possible.private <T> TNullPointerTester.getDefaultValue(TypeToken<T> type) private <T> TClassSanityTester.getDummyValue(TypeToken<T> type) private static <T> ImmutableList<Invokable<?, ? extends T>> ClassSanityTester.getFactories(TypeToken<T> type) Factories with the least number of parameters are listed first.private <T> TNullPointerTester.newDefaultReturningProxy(TypeToken<T> type) (package private) final <T> TReturns a new proxy forinterfaceType.Constructors in com.google.common.testing with parameters of type TypeToken