package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 点位状态
 *
 * @author: hzs
 */
@AllArgsConstructor
@Getter
public enum EPointStatus {

    /**
     * 正常
     */
    NORMAL(0, "正常", EnumsPrefixConstants.POINT_STATUS + 0),

    /**
     * 异常
     */
    ABNORMAL(1, "异常", EnumsPrefixConstants.POINT_STATUS + 1),

    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 国际化翻译key值
     */
    private final String key;

    /**
     * 根据值获取枚举名称
     *
     * @param val
     * @return
     */
    public static String getLabelByValue(int val) {
        for (EPointStatus ePointStatus : EPointStatus.values()) {
            if (ePointStatus.getValue() == val) {
                return ePointStatus.getLabel();
            }
        }
        return "";
    }

}
