public class TypeReference<T> extends Object
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 List<String>, you can create an empty anonymous inner class:
List<String> list = JSON.parseObject("...", new TypeReference<List<String>>() {});
public Type getType()
Copyright © 2012–2017 Alibaba Group. All rights reserved.