package com.engine.salary.enums.salaryformula;

import java.util.Arrays;
import java.util.Objects;

public enum FormulaVarFieldTypeEnum {
    NUMBER("number", "数值"),
    STRING("string", "字符");

    private String value;

    private String label;

    FormulaVarFieldTypeEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }


    public static FormulaVarFieldTypeEnum parseByValue(String value) {
        return Arrays.stream(FormulaVarFieldTypeEnum.values()).filter(typeEnum -> Objects.equals(typeEnum.getValue(), value)).findFirst().orElse(null);
    }
}
