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

com.didiglobal.logi.log.common.api.ResultFactory Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.didiglobal.logi.log.common.api;

/**
 * @author jinbinbin
 * @version $Id: ResultFactory.java, v 0.1 2018年01月10日 16:07 jinbinbin Exp $
 */
public class ResultFactory {

    public static  Result buildSuccessResult(T t) {
        return new Result(ResultCode.SUCCESS, t);
    }

    public static  Result buildSuccessResult() {
        return new Result(ResultCode.SUCCESS, null);
    }

    public static  Result buildIllegalParamResult(T t) {
        return new Result(ResultCode.ILLEGAL_PARAM, t);
    }

    public static  Result buildIllegalParamResult() {
        return new Result(ResultCode.ILLEGAL_PARAM, null);
    }

    public static  Result buildResourceNotReadyResult(T t) {
        return new Result(ResultCode.RESOURCE_NOT_READY, t);
    }

    public static  Result buildResourceNotReadyResult() {
        return new Result(ResultCode.RESOURCE_NOT_READY, null);
    }

    public static  Result buildResourceApprovingResult(T t) {
        return new Result(ResultCode.RESOURCE_APPROVING, t);
    }

    public static  Result buildResourceApprovingResult() {
        return new Result(ResultCode.RESOURCE_APPROVING, null);
    }

    public static  Result buildFailRequestResult(ResultCodeEntry resultCodeEntry) {
        return new Result(resultCodeEntry);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy