Uses of Class
com.google.common.reflect.TypeToken
-
Packages that use TypeToken Package Description com.google.common.reflect Utilities for reflection. -
-
Uses of TypeToken in com.google.common.reflect
Methods in com.google.common.reflect that return TypeToken Modifier and Type Method Description TypeToken<?>
TypeToken. getComponentType()
Returns the array component type if this type represents an array (int[]
,T[]
,<? extends Map<String, Integer>[]>
etc.), or elsenull
is returned.TypeToken<T>
Invokable. getOwnerType()
Returns the type ofT
.TypeToken<? extends R>
Invokable. getReturnType()
Returns the return type of thisInvokable
.TypeToken<? extends T>
TypeToken. getSubtype(Class<?> subclass)
Returns subtype ofthis
withsubclass
as the raw class.TypeToken<? super T>
TypeToken. getSupertype(Class<? super T> superclass)
Returns the generic form ofsuperclass
.TypeToken<?>
Parameter. getType()
Returns the type of the parameter.static <T> TypeToken<T>
TypeToken. of(Class<T> type)
Returns an instance of type token that wrapstype
.static TypeToken<?>
TypeToken. of(Type type)
Returns an instance of type token that wrapstype
.TypeToken<?>
TypeToken. resolveType(Type type)
Resolves the giventype
against the type context represented by this type.TypeToken<T>
TypeToken. unwrap()
Returns the corresponding primitive type if this is a wrapper type; otherwise returnsthis
itself.<X> TypeToken<T>
TypeToken. where(TypeParameter<X> typeParam, TypeToken<X> typeArg)
Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.<X> TypeToken<T>
TypeToken. where(TypeParameter<X> typeParam, Class<X> typeArg)
Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.TypeToken<T>
TypeToken. wrap()
Returns the corresponding wrapper type if this is a primitive type; otherwise returnsthis
itself.Methods in com.google.common.reflect that return types with arguments of type TypeToken Modifier and Type Method Description protected Map<TypeToken<? extends B>,B>
ImmutableTypeToInstanceMap. delegate()
protected Map<TypeToken<? extends @NonNull B>,B>
MutableTypeToInstanceMap. delegate()
protected Set<TypeToken<? super T>>
TypeToken.TypeSet. delegate()
Set<Map.Entry<TypeToken<? extends @NonNull B>,B>>
MutableTypeToInstanceMap. entrySet()
ImmutableList<TypeToken<? extends Throwable>>
Invokable. getExceptionTypes()
Returns all declared exception types of thisInvokable
.Methods in com.google.common.reflect with parameters of type TypeToken Modifier and Type Method Description <T extends B>
TImmutableTypeToInstanceMap. getInstance(TypeToken<T> type)
<T extends @NonNull B>
TMutableTypeToInstanceMap. getInstance(TypeToken<T> type)
<T extends @NonNull B>
TTypeToInstanceMap. getInstance(TypeToken<T> type)
Returns the value the specified type is mapped to, ornull
if no entry for this type is present.boolean
TypeToken. isSubtypeOf(TypeToken<?> type)
Returns true if this type is a subtype of the giventype
.boolean
TypeToken. isSupertypeOf(TypeToken<?> type)
Returns true if this type is a supertype of the giventype
.<T extends B>
ImmutableTypeToInstanceMap.Builder<B>ImmutableTypeToInstanceMap.Builder. put(TypeToken<T> key, T value)
Associateskey
withvalue
in the built map.B
ImmutableTypeToInstanceMap. put(TypeToken<? extends B> key, B value)
Deprecated.unsupported operationB
MutableTypeToInstanceMap. put(TypeToken<? extends @NonNull B> key, B value)
Deprecated.unsupported operation<T extends B>
TImmutableTypeToInstanceMap. putInstance(TypeToken<T> type, T value)
Deprecated.unsupported operation<T extends B>
TMutableTypeToInstanceMap. putInstance(TypeToken<@NonNull T> type, T value)
<T extends B>
TTypeToInstanceMap. putInstance(TypeToken<@NonNull T> type, T value)
Maps the specified type to the specified value.<R1 extends R>
Invokable<T,R1>Invokable. returning(TypeToken<R1> returnType)
Explicitly specifies the return type of thisInvokable
.<X> TypeToken<T>
TypeToken. where(TypeParameter<X> typeParam, TypeToken<X> typeArg)
Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.Method parameters in com.google.common.reflect with type arguments of type TypeToken Modifier and Type Method Description void
ImmutableTypeToInstanceMap. putAll(Map<? extends TypeToken<? extends B>,? extends B> map)
Deprecated.unsupported operationvoid
MutableTypeToInstanceMap. putAll(Map<? extends TypeToken<? extends @NonNull B>,? extends B> map)
Deprecated.unsupported operation
-