T
- the type to retrieve at runtimepublic abstract class TypeToken<T> extends Object
T
and to extract its type
information at runtime.
To retrieve the type at runtime, create a subclass and call getType()
:
Type listOfStringsType = new TypeToken>() {}.getType();
Inspired by GSON's TypeToken
.
Constructor and Description |
---|
TypeToken() |
public Type getType()
Copyright © 2020. All rights reserved.