package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 对账结果
 * @author: DingJie
 * @create: 2021/8/910:44
 */
public enum StmtRslt {

    CORRECT("0", "平"),

    WRONG("1", "不平");

    private final String code;
    private final String name;

    StmtRslt(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static StmtRslt get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (StmtRslt stmtRslt : StmtRslt.values()) {
            if (code.trim().equals(stmtRslt.getCode())) {
                return stmtRslt;
            }
        }
        return null;
    }
}
