package com.engine.salary.enums.common;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;


public enum SharedTypeEnum implements BaseEnum<Integer> {
    PRIVATE(1, "私有", 86569),
    PUBLIC(0, "共享", 86568);

    private Integer value;

    private String defaultLabel;

    private Integer labelId;

    SharedTypeEnum(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 SharedTypeEnum parseByValue(Integer value) {
        for (SharedTypeEnum enums : SharedTypeEnum.values()) {
            if (Objects.equals(enums.getValue(), value)) {
                return enums;
            }
        }
        return PUBLIC;
    }
}
