package com.bocloud.cmp.entity.enums;

/**
 * @author liuyuanyuan
 * @version 1.0.0
 * @description: TODO
 */
public enum CacheMode {

    single("single", "单机"),
    ha("ha", "主备"),
    cluster("cluster", "cluster集群"),
    proxy("proxy", "Proxy集群"),
    storageType("DRAM", "内存存储"),
    pay_Need("0", "按需计费"),
    pay_Years("1", "包年/包月计费"),
    ROUND_ROBIN("ROUND_ROBIN","加权轮询算法"),
    LEAST_CONNECTIONS("LEAST_CONNECTIONS","加权最少连接算法"),
    SOURCE_IP("SOURCE_IP","源IP算法"),
    AutoRenewal("AutoRenewal","自动续费"),
    Normal("Normal","非自动续费"),
    NotRenewal("NotRenewal","不再续费"),
    NonProtection("NonProtection","不保护"),
    ConsoleProtection("ConsoleProtection","控制台修改保护"),
    CayByBandwidth("paybybandwidth","按带宽计费"),
    PayByTraffic("paybytraffic","按流量计费"),
    DBInstanceClassType_S("s","共享型"),
    DBInstanceClassType_X("x","通用型"),
    DBInstanceClassType_D("d","独享套餐"),
    DBInstanceClassType_H("h","独占物理机"),
    PayType_Postpaid("Postpaid","按量付费"),
    PayType_Prepaid("Prepaid","预付费"),
    Auto("Auto","自动升级小版本"),
    Manual("Manual","不自动升级"),
    PrePay("PrePay","预付费"),
    PayOnDemand("PayOnDemand","按量付费"),
    LOCAL_SSD("local_ssd","本地SSD盘"),
    EPHEMERAL_SSD("ephemeral_ssd","本地SSD盘"),
    CLOUD_SSD("cloud_ssd","SSD云盘"),
    CLOUD_ESSD("cloud_essd","ESSD云盘"),
    ULTRAHIGH("ULTRAHIGH","SSD"),
    LOCALSSD("LOCALSSD","本地SSD");
    private String code;
    private String name;

    CacheMode(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String byValue(String code) {
        for (CacheMode cacheMode : CacheMode.values()) {
            if (cacheMode.code.equalsIgnoreCase(code)) {
                return cacheMode.name;
            }
        }
        return code;
    }
}
