package com.cmvr.test.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BranchConditionOpEnum {
    EQUAL("equal"),
    NOT_EQUAL("notEqualTo"),
    NULL("null"),
    NOT_NULL("notNull"),
    INCLUDE("include"),
    NOT_INCLUDE("notInclude"),
    GREATER_THAN("greaterThan"),
    GREATER_THAN_OR_EQUAL("greaterThanOrEqual"),
    LESS_THAN("lessThan"),
    LESS_THAN_OR_EQUAL("lessThanOrEqual");

    private final String value;


    public static BranchConditionOpEnum fromValue(String val) {
        for (BranchConditionOpEnum op : values()) {
            if (op.value.equalsIgnoreCase(val)) {
                return op;
            }
        }
        throw new IllegalArgumentException("未知条件操作符: " + val);
    }

}
