package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

public enum ReadCardBizType {
    ADMISSION("01103"),
    SETTLEMENT("01301"),
    NONE("none");

    private final String code;

    public String getCode() {
        return code;
    }

    ReadCardBizType(String code) {
        this.code = code;
    }

    public static ReadCardBizType get(String code) {
        if (StringUtil.isBlank(code)) {
            return NONE;
        }
        for (ReadCardBizType readCardBizType : ReadCardBizType.values()) {
            if (code.trim().equals(readCardBizType.getCode())) {
                return readCardBizType;
            }
        }
        return NONE;
    }
}
