package com.engine.salary.enums.sicategory;


import com.engine.salary.enums.BaseEnum;

import java.math.BigDecimal;
import java.util.Arrays;

@Deprecated
public enum RententionRuleEnum implements BaseEnum<Integer> {
    ROUND(BigDecimal.ROUND_HALF_UP, "四舍五入", 84505),
    CEIL(BigDecimal.ROUND_UP, "向上舍入", 84506),
    FLOOR(BigDecimal.ROUND_DOWN, "向下舍入", 84507),
    CEILING(5, "见分进角", 84507),
    UP_EVEN(6, "向上求偶", 84507);

    private int value;

    private String defaultLabel;

    private int lavelId;

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

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

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

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

    public static String getDefaultLabelByValue(Integer value) {
        if (value == null) {
            return "";
        }
        RententionRuleEnum[] enumAry = RententionRuleEnum.values();
        for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
            if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
                return enumAry[i].getDefaultLabel();
            }
        }
        return "";
    }
}
