bluelinelabs / LoganSquare

Screaming fast JSON parsing and serialization library for Android.
Apache License 2.0
3.21k stars 306 forks source link

how to convert complex generic type? #205

Open stoneLee81 opened 7 years ago

stoneLee81 commented 7 years ago

Is there a demo to explain how to convert complex generic type data? data type for instance,

public class DataObject {

private String status;

private String errorCode;

private String message = "";

private String type;

private T data;

private PageInfo<T> page;

}

public class PageInfo {

private int page = 1;

private int pageSize = 10;

private int total;

private int maxPage;

private List<T> items;

}

bluef commented 6 years ago

check out the roundtrip test

https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/processor/src/test/java/com/bluelinelabs/logansquare/processor/RoundTripTests.java#L165