package org.kne.cloud.network.klalb;

import org.kne.cloud.network.klalb.ui.UIEnv;

public enum PerformanceStrategy {
    SINGLE_CORE("singlecore"),
    MULTI_FILL("multifill"),
    MULTI_SCATTER("multiscatter");

    private String description;

    private PerformanceStrategy(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return description;
    }

    /**
     * 根据 description 查找对应的枚举对象。
     *
     * @param description 描述文本（资源包key）
     * @return 对应的枚举对象
     */
    public static PerformanceStrategy fromDescription(String description) {
        for (PerformanceStrategy strategy : values()) {
            if (strategy.description.equals(description)) {
                return strategy;
            }
        }
        return null;
    }
}