package io.synor.compute;

/**
 * Task priority levels for job scheduling.
 */
public enum Priority {
    /** Critical priority - highest */
    CRITICAL("critical"),
    /** High priority */
    HIGH("high"),
    /** Normal priority (default) */
    NORMAL("normal"),
    /** Low priority */
    LOW("low"),
    /** Background priority - lowest */
    BACKGROUND("background");

    private final String value;

    Priority(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static Priority fromValue(String value) {
        for (Priority p : values()) {
            if (p.value.equalsIgnoreCase(value)) {
                return p;
            }
        }
        throw new IllegalArgumentException("Unknown priority: " + value);
    }
}
