package com.jwipc.finance.constant;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
public enum WHETHER {
    /**
     * 单例对象
     */
    NOUSE(0, "未使用"),
    ACCOUNTUSE(1, "对账单使用"),
    OFFLINEUSE(2, "线下使用");



    private final int type;
    private final String name;

    /**
     * 默认构造函数
     */
    WHETHER(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static WHETHER forType(int type) {
        for (WHETHER value : WHETHER.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }
}

