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

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

public enum CardTypeEnum {

    IdCard("居民身份证", 1),
    MedicalCard("社保卡", 2),
    Passport("护照/港澳台通行证", 3);

    private final String displayName;

    private final int value;

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

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

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