Package | Description |
---|---|
com.google.common.reflect |
This package contains utilities to work with Java reflection.
|
Modifier and Type | Method and Description |
---|---|
@Nullable TypeToken<?> |
TypeToken.getComponentType()
Returns the array component type if this type represents an array (
int[] , T[] ,
<? extends Map<String, Integer>[]> etc.), or else null is returned. |
TypeToken<T> |
Invokable.getOwnerType()
Returns the type of
T . |
TypeToken<? extends R> |
Invokable.getReturnType()
Returns the return type of this
Invokable . |
TypeToken<? extends T> |
TypeToken.getSubtype(Class<?> subclass)
Returns subtype of
this with subclass as the raw class. |
TypeToken<? super T> |
TypeToken.getSupertype(Class<? super T> superclass)
Returns the generic form of
superclass . |
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 wraps
type . |
static TypeToken<?> |
TypeToken.of(Type type)
Returns an instance of type token that wraps
type . |
TypeToken<?> |
TypeToken.resolveType(Type type)
Resolves the given
type against the type context represented by this type. |
TypeToken<T> |
TypeToken.unwrap()
Returns the corresponding primitive type if this is a wrapper type; otherwise returns
this itself. |
<X> TypeToken<T> |
TypeToken.where(TypeParameter<X> typeParam,
Class<X> typeArg)
Returns a new
TypeToken where type variables represented by typeParam are
substituted by typeArg . |
<X> TypeToken<T> |
TypeToken.where(TypeParameter<X> typeParam,
TypeToken<X> typeArg)
Returns a new
TypeToken where type variables represented by typeParam are
substituted by typeArg . |
TypeToken<T> |
TypeToken.wrap()
Returns the corresponding wrapper type if this is a primitive type; otherwise returns
this itself. |
Modifier and Type | Method and Description |
---|---|
protected Map<TypeToken<? extends B>,B> |
ImmutableTypeToInstanceMap.delegate() |
protected Set<TypeToken<? super T>> |
TypeToken.TypeSet.delegate() |
protected Map<TypeToken<? extends B>,B> |
MutableTypeToInstanceMap.delegate() |
Set<Map.Entry<TypeToken<? extends B>,B>> |
MutableTypeToInstanceMap.entrySet() |
ImmutableList<TypeToken<? extends Throwable>> |
Invokable.getExceptionTypes()
Returns all declared exception types of this
Invokable . |
Modifier and Type | Method and Description |
---|---|
<T extends B> |
ImmutableTypeToInstanceMap.getInstance(TypeToken<T> type) |
<T extends B> |
TypeToInstanceMap.getInstance(TypeToken<T> type)
Returns the value the specified type is mapped to, or
null if no entry for this type is
present. |
<T extends B> |
MutableTypeToInstanceMap.getInstance(TypeToken<T> type) |
boolean |
TypeToken.isSubtypeOf(TypeToken<?> type)
Returns true if this type is a subtype of the given
type . |
boolean |
TypeToken.isSupertypeOf(TypeToken<?> type)
Returns true if this type is a supertype of the given
type . |
B |
ImmutableTypeToInstanceMap.put(TypeToken<? extends B> key,
B value)
Deprecated.
unsupported operation
|
B |
MutableTypeToInstanceMap.put(TypeToken<? extends B> key,
B value)
Deprecated.
unsupported operation
|
<T extends B> |
ImmutableTypeToInstanceMap.Builder.put(TypeToken<T> key,
T value)
Associates
key with value in the built map. |
<T extends B> |
ImmutableTypeToInstanceMap.putInstance(TypeToken<T> type,
T value)
Deprecated.
unsupported operation
|
<T extends B> |
TypeToInstanceMap.putInstance(TypeToken<T> type,
T value)
Maps the specified type to the specified value.
|
<T extends B> |
MutableTypeToInstanceMap.putInstance(TypeToken<T> type,
T value) |
<R1 extends R> |
Invokable.returning(TypeToken<R1> returnType)
Explicitly specifies the return type of this
Invokable . |
<X> TypeToken<T> |
TypeToken.where(TypeParameter<X> typeParam,
TypeToken<X> typeArg)
Returns a new
TypeToken where type variables represented by typeParam are
substituted by typeArg . |
Modifier and Type | Method and Description |
---|---|
void |
ImmutableTypeToInstanceMap.putAll(Map<? extends TypeToken<? extends B>,? extends B> map)
Deprecated.
unsupported operation
|
void |
MutableTypeToInstanceMap.putAll(Map<? extends TypeToken<? extends B>,? extends B> map)
Deprecated.
unsupported operation
|
Copyright © 2010–2019. All rights reserved.