Example usage for Java com.google.common.reflect TypeToken fields, constructors, methods, implement or subclass
The text is from its open source code.
TypeToken() Constructs a new type token of T . | |
TypeToken(Class> declaringClass) Constructs a new type token of T while resolving free type variables in the context of declaringClass . | |
TypeToken(Type type) |
Invokable | constructor(Constructor> constructor) Returns the Invokable for constructor , which must be a member of T . |
boolean | equals(@Nullable Object o) Returns true if o is another TypeToken that represents the same Type . |
TypeToken> | getComponentType() Returns the array component type if this type represents an array ( int[] , T[] , |
Class super T> | getRawType() Returns the raw type of T . |
TypeToken extends T> | getSubtype(Class> subclass) Returns subtype of this with subclass as the raw class. |
TypeToken super T> | getSupertype(Class super T> superclass) Returns the generic form of superclass . |
Type | getType() Returns the represented type. |
TypeSet | getTypes() Returns the set of interfaces and classes that this type is or is a subtype of. |
int | hashCode() |
boolean | isArray() Returns true if this type is known to be an array type, such as int[] , T[] , |
boolean | isAssignableFrom(TypeToken> type) Returns true if this type is a supertype of the given type . |
boolean | isAssignableFrom(Type type) Returns true if this type is a supertype of the given type . |
boolean | isPrimitive() Returns true if this type is one of the nine primitive types (including void ). |
boolean | isSubtypeOf(TypeToken> type) Returns true if this type is a subtype of the given type . |
boolean | isSubtypeOf(Type supertype) Returns true if this type is a subtype of the given type . |
boolean | isSupertypeOf(TypeToken> type) Returns true if this type is a supertype of the given type . |
boolean | isSupertypeOf(Type type) Returns true if this type is a supertype of the given type . |
Invokable | method(Method method) Returns the Invokable for method , which must be a member of T . |
TypeToken | of(Class Returns an instance of type token that wraps type . |
TypeToken> | of(Type type) Returns an instance of type token that wraps type . |
TypeToken> | resolveType(Type type) Resolves the given type against the type context represented by this type. |
String | toString() |
TypeToken | unwrap() Returns the corresponding primitive type if this is a wrapper type; otherwise returns this itself. |
TypeToken | where(TypeParameter Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg . |
TypeToken | where(TypeParameter Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg . |
TypeToken | wrap() Returns the corresponding wrapper type if this is a primitive type; otherwise returns this itself. |