Generics with Spring RESTTemplate

后端 未结 4 1866
梦毁少年i
梦毁少年i 2020-11-28 23:31

I have a class like that:

public class Wrapper {

 private String message;
 private T data;

 public String getMessage() {
    return message;
 }

          


        
4条回答
  •  情深已故
    2020-11-29 00:03

    Do not use generics with RestTemplate. Wrap request and response object with wrapper object that will hide the generics.

提交回复
热议问题