package com.yuchen.saas.park.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 颜艺波
 * @date 2022/8/19 17:11
 * @Description
 */
@Getter
@AllArgsConstructor
public enum MaskEnum {

    UNKNOWN(0, "未知"),

    YES(1, "是"),

    NO(2, "否");

    private Integer code;

    private String description;

    public static String getDescByCode(Integer code) {
        MaskEnum[] maskEnumArray = MaskEnum.values();
        for (MaskEnum maskEnum : maskEnumArray) {
            if (maskEnum.getCode().equals(code)) {
                return maskEnum.getDescription();
            }
        }
        return UNKNOWN.getDescription();
    }
}
