
package org.jeecg.modules.workFlow.flowlong.engine.core.enums;

import lombok.Getter;

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

/**
 * 流程优先级
 *

 */
@Getter
public enum InstancePriority {
    /**
     * 普通
     */
    normal(0),
    /**
     * 异步
     */
    async(1);

    private final int value;

    InstancePriority(int value) {
        this.value = value;
    }

    public boolean ne(Integer value) {
        return !eq(value);
    }

    public boolean eq(Integer value) {
        return Objects.equals(this.value, value);
    }

    public static InstancePriority get(int value) {
        return Arrays.stream(InstancePriority.values()).filter(s -> s.getValue() == value).findFirst().orElse(null);
    }
}
