package com.engine.salary.report.enums;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * 薪资项目的字段类型
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum SalaryDataTypeEnum implements BaseEnum<String> {
    STRING("string", "字符", 105093),
    NUMBER("number", "数值", 87625),
    ;

    private String value;

    private String defaultLabel;

    private int labelId;

    SalaryDataTypeEnum(String value, String defaultLabel, int labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public Integer getLabelId() {
        return this.labelId;
    }

    @Override
    public String getDefaultLabel() {
        return this.defaultLabel;
    }

    public static SalaryDataTypeEnum parseByValue(String value) {
        for (SalaryDataTypeEnum salaryDataTypeEnum : SalaryDataTypeEnum.values()) {
            if (Objects.equals(salaryDataTypeEnum.getValue(), value)) {
                return salaryDataTypeEnum;
            }
        }
        return null;
    }
}
