T - The type represented by this TypeToken.public abstract class TypeToken<T> extends Object
Type.
You can use this to create instances of Type for a type known at compile
time.
For example, to get the Type that represents List<String>:
Type listOfString = new TypeToken<List<String>>(){}.getType();| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static <T> TypeToken<T> |
get(Class<T> type)
Gets type token for the given
Class instance. |
static TypeToken<?> |
get(Type type)
Gets type token for the given
Type instance. |
Type |
getType() |
int |
hashCode() |
public Type getType()
Copyright © 2008–2017. All rights reserved.