package com.engine.salary.report.enums;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

public enum SalaryStatisticsItemStringRuleEnum implements BaseEnum<String> {


    LAST("last", "最近值", 83993),
    OLD("old", "最早值", 83994),
    FREQUENT("frequent", "最频繁", 83994),
    TILE("tile", "平铺", 83994),
    ;

    private String value;

    private String defaultLabel;

    private int labelId;

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

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

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

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

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

}
