-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Milestone
Description
/**
* 分页结果对象.
* @author ZY ([email protected])
*/
@Getter
@Setter
@Json(naming = Json.Naming.LowerUnderscore)
public class PageResult<ITEM> {
/**
* 页码.
*/
private int page;
/**
* 每页的数量.
*/
private int pageSize;
/**
* 总数量.
*/
private int totalCount;
/**
* 总页数量.
*/
private int totalPageCount;
/**
* 数据项.
*/
private List<? extends ITEM> items;
}
Generated:
@Generated
public final class PageResultJsonAdapter extends JsonAdapter<PageResult> implements ViewBuilderAware {
// naming convention LowerUnderscore
// page [int] name:page setter:setPage
// pageSize [int] name:page_size setter:setPageSize
// totalCount [int] name:total_count setter:setTotalCount
// totalPageCount [int] name:total_page_count setter:setTotalPageCount
// items [java.util.List<? extends ITEM>] name:items setter:setItems
private final JsonAdapter<Integer> pintJsonAdapter;
private final JsonAdapter<List<ITEM>> listITEMJsonAdapter;
private final PropertyNames names;
public PageResultJsonAdapter(Jsonb jsonb) {
this.pintJsonAdapter = jsonb.adapter(Integer.TYPE);
this.listITEMJsonAdapter = jsonb.adapter(Types.listOf(? extends ITEM.class));
this.names = jsonb.properties("page", "page_size", "total_count", "total_page_count", "items");
}
// ...
// ...
}
private final JsonAdapter<List<ITEM>> listITEMJsonAdapter;
Compilation will report an error.