public final class GenericsUtils extends Object
| Constructor and Description |
|---|
GenericsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isGenericResponseType(Type type)
check if XXX.class is generic type.
|
public static boolean isGenericResponseType(Type type)
List>> response = consumers.getSCBRestTemplate()
postForObject("/testListObjectParam", request, List.class);
should work for versions of 1.*. This is because java-chassis can read type info from swaggers.
Start from 2.x, the best practise to write this code is to use ParameterizedTypeReference provided by RestTemplate
exchange method.Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.