T
- the real typepublic abstract class GenericType<T> extends Object
GenericType<List<Integer>> genericType = new GenericType<List<Integer>>() { }; List<Integer> listOfIntegers = new Genson().deserialize("[1,2,3]", genericType); // if you want to get the standard java.lang.reflect.Type corresponding to List<Integer> from // genericType Type listOfIntegersType = genericType.getType(); // listOfIntegersType will be an instance of ParameterizedType with Integer class as type argument
Modifier | Constructor and Description |
---|---|
protected |
GenericType() |
Modifier and Type | Method and Description |
---|---|
Class<T> |
getRawClass() |
Type |
getType() |
static <T> GenericType<T> |
of(Class<T> rawClass) |
static GenericType<Object> |
of(Type type) |
public static <T> GenericType<T> of(Class<T> rawClass)
public static GenericType<Object> of(Type type)
public Type getType()
Copyright © 2019. All rights reserved.