All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.somta.core.protocol.ResponsePaginationDataResult Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package net.somta.core.protocol;


import net.somta.core.base.IBaseError;

import java.util.List;

public class ResponsePaginationDataResult extends ResponseResult {

    private Long total;
    private List result;

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List getResult() {
        return result;
    }

    public void setResult(List result) {
        this.result = result;
    }

    public static ResponsePaginationDataResult setPaginationDataResult(Long total, List resultList) {
        ResponsePaginationDataResult r = new ResponsePaginationDataResult();
        r.setTotal(total);
        r.setSuccess(true);
        r.setResult(resultList);
        return r;
    }

    public static ResponsePaginationDataResult setErrorResponseResult(IBaseError baseError) {
        return setErrorResponseResult(baseError, null);
    }

    public static ResponsePaginationDataResult setErrorResponseResult(IBaseError baseError,List data) {
        ResponsePaginationDataResult r = new ResponsePaginationDataResult();
        r.setTotal(0L);
        r.setSuccess(false);
        r.setErrorCode(baseError.getErrorCode());
        r.setErrorMsg(baseError.getErrorMsg());
        r.setResult(data);
        return r;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy