Java com.google.common.reflect TypeToken fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.reflect TypeToken fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.reflect TypeToken.

The text is from its open source code.

Subclass

com.google.common.reflect.TypeToken has subclasses.
Click this link to see all its subclasses.

Constructor

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)

Method

Invokableconstructor(Constructor constructor)
Returns the Invokable for constructor , which must be a member of T .
booleanequals(@Nullable Object o)
Returns true if o is another TypeToken that represents the same Type .
TypeTokengetComponentType()
Returns the array component type if this type represents an array ( int[] , T[] ,
ClassgetRawType()
Returns the raw type of T .
TypeTokengetSubtype(Class subclass)
Returns subtype of this with subclass as the raw class.
TypeTokengetSupertype(Class superclass)
Returns the generic form of superclass .
TypegetType()
Returns the represented type.
TypeSetgetTypes()
Returns the set of interfaces and classes that this type is or is a subtype of.
inthashCode()
booleanisArray()
Returns true if this type is known to be an array type, such as int[] , T[] ,
booleanisAssignableFrom(TypeToken type)
Returns true if this type is a supertype of the given type .
booleanisAssignableFrom(Type type)
Returns true if this type is a supertype of the given type .
booleanisPrimitive()
Returns true if this type is one of the nine primitive types (including void ).
booleanisSubtypeOf(TypeToken type)
Returns true if this type is a subtype of the given type .
booleanisSubtypeOf(Type supertype)
Returns true if this type is a subtype of the given type .
booleanisSupertypeOf(TypeToken type)
Returns true if this type is a supertype of the given type .
booleanisSupertypeOf(Type type)
Returns true if this type is a supertype of the given type .
Invokablemethod(Method method)
Returns the Invokable for method , which must be a member of T .
TypeTokenof(Class type)
Returns an instance of type token that wraps type .
TypeTokenof(Type type)
Returns an instance of type token that wraps type .
TypeTokenresolveType(Type type)

Resolves the given type against the type context represented by this type.

StringtoString()
TypeTokenunwrap()
Returns the corresponding primitive type if this is a wrapper type; otherwise returns this itself.
TypeTokenwhere(TypeParameter typeParam, TypeToken typeArg)

Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg .

TypeTokenwhere(TypeParameter typeParam, Class typeArg)

Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg .

TypeTokenwrap()
Returns the corresponding wrapper type if this is a primitive type; otherwise returns this itself.