Uses of Class
com.google.common.reflect.TypeToken
-
Uses of TypeToken in com.google.common.reflect
Modifier and TypeClassDescriptionfinal class
A type-to-instance map backed by anImmutableMap
.final class
MutableTypeToInstanceMap<B extends @Nullable Object>
A mutable type-to-instance map.class
The set of interfaces and classes thatT
is or is a subtype of.Modifier and TypeInterfaceDescriptioninterface
TypeToInstanceMap<B extends @Nullable Object>
A map, each entry of which maps aTypeToken
to an instance of that type.Modifier and TypeMethodDescriptionTypeToken.getComponentType()
Returns the array component type if this type represents an array (int[]
,T[]
,<? extends Map<String, Integer>[]>
etc.), or elsenull
is returned.Invokable.getOwnerType()
Returns the type ofT
.Invokable.getReturnType()
Returns the return type of thisInvokable
.TypeToken.getSubtype
(Class<?> subclass) Returns subtype ofthis
withsubclass
as the raw class.TypeToken.getSupertype
(Class<? super T> superclass) Returns the generic form ofsuperclass
.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
.final TypeToken
<?> TypeToken.resolveType
(Type type) Resolves the giventype
against the type context represented by this type.TypeToken.unwrap()
Returns the corresponding primitive type if this is a wrapper type; otherwise returnsthis
itself.TypeToken.where
(TypeParameter<X> typeParam, TypeToken<X> typeArg) Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.TypeToken.where
(TypeParameter<X> typeParam, Class<X> typeArg) Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.TypeToken.wrap()
Returns the corresponding wrapper type if this is a primitive type; otherwise returnsthis
itself.Modifier and TypeMethodDescriptionImmutableTypeToInstanceMap.delegate()
MutableTypeToInstanceMap.delegate()
TypeToken.TypeSet.delegate()
MutableTypeToInstanceMap.entrySet()
final ImmutableList
<TypeToken<? extends Throwable>> Invokable.getExceptionTypes()
Returns all declared exception types of thisInvokable
.Modifier and TypeMethodDescriptionImmutableTypeToInstanceMap.getInstance
(TypeToken<T> type) MutableTypeToInstanceMap.getInstance
(TypeToken<T> type) TypeToInstanceMap.getInstance
(TypeToken<T> type) Returns the value the specified type is mapped to, ornull
if no entry for this type is present.final boolean
TypeToken.isSubtypeOf
(TypeToken<?> type) Returns true if this type is a subtype of the giventype
.final boolean
TypeToken.isSupertypeOf
(TypeToken<?> type) Returns true if this type is a supertype of the giventype
.<T extends B>
ImmutableTypeToInstanceMap.Builder<B> Associateskey
withvalue
in the built map.Deprecated.unsupported operationDeprecated.unsupported operationImmutableTypeToInstanceMap.putInstance
(TypeToken<T> type, T value) Deprecated.unsupported operationMutableTypeToInstanceMap.putInstance
(TypeToken<@NonNull T> type, T value) TypeToInstanceMap.putInstance
(TypeToken<@NonNull T> type, T value) Maps the specified type to the specified value.Explicitly specifies the return type of thisInvokable
.TypeToken.where
(TypeParameter<X> typeParam, TypeToken<X> typeArg) Returns a newTypeToken
where type variables represented bytypeParam
are substituted bytypeArg
.