1. Interface returns on generic types (String or complex type) is specified, then TypeReference these types will be a one-to-one correspondence relationship in the form of key-value pairs in the Map, later again the same specified type, from the cache to read the Map information to find the corresponding type deserialization.
2. Interface if you do not specify a return type, TypeReference will read the default type of the parent to match (simple the default String type, complex type defaults to JsonObject), that is the reason why cause the failure of the sequence,
Conclusion: if you want to use TypeReference generic tools, all return to the interface used to specify a return type, to avoid the above problems,
CodePudding user response:
A bit, then I don't understand why you post must be put a few minutes,,,,,,,