package com.ywt.outpatient.domain.models.enums;

/**
 * @author Walker
 * Created on 2021/6/30
 */
public enum CommonStatusEnum {

    NORMAL("正常", 0),
    DISABLE("禁用", 1);

    private final String displayName;

    private final int value;

    CommonStatusEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static CommonStatusEnum valueOf(int value) {
        for (CommonStatusEnum e : CommonStatusEnum.values()) {
            if (e.getValue() == value) {
                return e;
            }
        }
        return NORMAL;
    }
}