Type Token
Represents a generic type {@code T}
. Java doesn't yet provide a way to represent generic types, so this class does. Forces clients to create a subclass of this class which enables retrieval the type information even at runtime.
For example, to create a type literal for {@code List}
, you can create an empty anonymous inner class:
{@code TypeToken
This syntax cannot be used to create type literals that have wildcard parameters, such as {@code Class}
or {@code List}
.
Author
Bob Lee
Sven Mawson
Jesse Wilson