Generic types in array with Google HTTP Client Library

121 Views Asked by At

I have base http response which looks like:

{ 
"data" : [], 
"total" : 0, 
"hasMore" : false
}

In data can be any object - Users, FeedItems and etc.

So i want create base class something like

public class BaseDataReponse<T> {

@Key
public List<T> data;

@Key
public Integer total;

@Key
public Boolean hasMore;

}

I can do so in Retrofit for Android library.

But i can't understand how to do this in Google HTTP Client Library.

0

There are 0 best solutions below