package com.engine.salary.enums.sicategory;

import com.engine.salary.enums.BaseEnum;

import java.util.Arrays;


public enum WelfareTypeEnum implements BaseEnum<Integer> {
    SOCIAL_SECURITY(1, "社保", 86568),
    ACCUMULATION_FUND(2, "公积金", 86569),
    OTHER(3, "企业年金及其它福利", 86570);

    private Integer value;

    private String defaultLabel;

    private Integer labelId;

    WelfareTypeEnum(Integer value, String defaultLabel, Integer labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }


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

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

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

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