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

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


//取件方式
public enum MedicalRecordMailingOrdersDeliveryTypeEnum {

    /**
     * 取件方式，1-邮寄，2-自取
     */
    Mailing("邮寄", 1),
    Invite("自取", 2);

    private final String displayName;

    private final int value;

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

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

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