您的位置:首页 > 编程语言 > Java开发

java 通用的返回类

2016-03-23 17:21 351 查看
package com.eshore.pdip.mobile.phone.vo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.eshore.pdip.mobile.util.Pager;
import com.eshore.pdip.mobile.util.ResultCodes;

public class Result implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;

/**
* ������
*/
private String resultCode = ResultCodes.INVOKE_SUCC;

private String msg;

private Object resultObj;

private List<?> resultList;

private String callback;

private int pageNo = 1; // ҳ��
private int pageSize = 10; // ÿҳ����
private int totalPageCount = 0; // ��ҳ��
private int totalCount = 0; // ������
private int currentPageNo = 1; // ������

public int getCurrentPageNo() {
return currentPageNo;
}

public void setCurrentPageNo(int currentPageNo) {
this.currentPageNo = currentPageNo;
}

private Map<String, Object> ignoreMap = new HashMap<String, Object>();

public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}

public Object getResultObj() {
return resultObj;
}

public void setResultObj(Object resultObj) {
this.resultObj = resultObj;
}

public List<?> getResultList() {
return resultList;
}

public void setResultList(List<?> resultList) {
this.resultList = resultList;
}

public int getPageNo() {
return pageNo;
}

public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}

public int getPageSize() {
return pageSize;
}

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

public int getTotalPageCount() {
return totalPageCount;
}

public void setTotalPageCount(int totalPageCount) {
this.totalPageCount = totalPageCount;
}

public int getTotalCount() {
return totalCount;
}

public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}

public Map<String, Object> getIgnoreMap() {
return ignoreMap;
}

public void setIgnoreMap(Map<String, Object> ignoreMap) {
this.ignoreMap = ignoreMap;
}

public String getCallback() {
return callback;
}

public void setCallback(String callback) {
this.callback = callback;
}

public String getResultCode() {
return resultCode;
}

public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}

public void put(String key, Object value) {
this.ignoreMap.put(key, value);
}

public void initPagerResult(Pager pager) {
if (pager != null) {
this.pageNo = pager.getPageNumber();
this.pageSize = pager.getPageSize();
this.totalCount = pager.getTotalCount();
this.totalPageCount = pager.getPageCount();
this.currentPageNo=pager.getPageNumber();
}
}

@Override
public String toString() {
return "Result [resultCode=" + resultCode + ", msg=" + msg + "]";
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: