package com.energy.manage.common.enums;

/**
 * 删除枚举
 */
public enum DeleteStatusEnum {
  NODELETE(0, "未删除"),
  DELETE(1, "删除");

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

  private Integer code;
  private String name;


  public Integer getCode() {
    return code;
  }

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

  public String getName() {
    return name;
  }

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

  public static String getKeyByValue(Integer code){
    for(DeleteStatusEnum e : values()){
      if(code.equals(e.code)){
        return e.name;
      }
    }
    return "Not exist";
  }

  public static DeleteStatusEnum getFastReplyType(Integer code){
    for(DeleteStatusEnum e : values()){
      if(code.equals(e.code)){
        return e;
      }
    }
    return null;
  }
}
