How can I serialize and deserialize this object with gson to json:
public class test{
@Expose
public List< Pair<Double,Double> > list;
@Expose
public int alpha;
}
I've tried this:
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
String str = gson.toJson(testInstance,test.class);
where testInstance is an instance of class test, but it's not working because of Pair structure in List.