package com.bocloud.cmp.entity.enums;

/**
 * 主机组布置策略
 *
 * @author luyanchao
 * @since 2019/1/30 16:10
 */
public enum PowervcOsAggregateInitialPolicy {
    DISPERSE(1, "分散"),
    FILL(2, "填满"),
    CPU_DISTRIBUTE_BALANCE(3, "CPU分配平衡"),
    MEM_DISTRIBUTE_BALANCE(4, "内存分配平衡"),
    CPU_USE_BALANCE(5, "CPU利用率平衡"),
    MEM_USE_BALANCE(6, "内存利用率平衡");
    private int id;
    private String text;

    PowervcOsAggregateInitialPolicy(int id, String text) {
        this.id = id;
        this.text = text;
    }

    public static String getText(int id) {
        for (PowervcOsAggregateInitialPolicy value : PowervcOsAggregateInitialPolicy.values()) {
            if (value.id == id) {
                return value.text;
            }
        }
        return null;
    }

    public static Integer getId(String text) {
        for (PowervcOsAggregateInitialPolicy value : PowervcOsAggregateInitialPolicy.values()) {
            if (value.text.equals(text)) {
                return value.id;
            }
        }
        return null;
    }
}
