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

import com.ywt.mg.core.utils.Checker;

/**
 * 阅读状态，1-未阅，2-已阅，当后台点击了“详情”或“审核”，状态“未阅”变为“已阅”
 */

public enum MedicalRecordMailingOrdersReadStatusEnum {

    /**
     * 阅读状态，1-未阅，2-已阅，当后台点击了“详情”或“审核”，状态“未阅”变为“已阅”
     */
    NotRead("未阅", 1),
    HasRead("已阅", 2);

    private final String displayName;

    private final int value;

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

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static MedicalRecordMailingOrdersReadStatusEnum valueOf(int value) {
        for (MedicalRecordMailingOrdersReadStatusEnum enumObj : MedicalRecordMailingOrdersReadStatusEnum.values()) {
            if (enumObj.getValue() == value) {
                return enumObj;
            }
        }
        return null;
    }
    public static String getDisplayName(int value) {
        MedicalRecordMailingOrdersReadStatusEnum enumObj = valueOf(value);
        if (!Checker.isNone(enumObj)){
            return enumObj.displayName;
        }
        return "";
    }
}
