java.lang.Object
io.leangen.geantyref.TypeToken<T>
- Type Parameters:
T- The type represented by this TypeToken.
Wrapper around
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();- Author:
- Wouter Coekaerts (wouter@coekaerts.be)
-
Constructor Details
-
TypeToken
protected TypeToken()Constructs a type token.
-
-
Method Details
-
get
Gets type token for the givenClassinstance.- Type Parameters:
T- The generic type captured by the token- Parameters:
type- The class from which the token is created- Returns:
- TypeToken corresponding to the provided class
-
get
Gets type token for the givenTypeinstance.- Parameters:
type- The type from which the token is created- Returns:
- TypeToken corresponding to the provided type
-
getType
-
getAnnotatedType
-
getCanonicalType
-
equals
-
hashCode
public int hashCode()
-