package com.railway.business.catenary.enums;

/**
 * 排序类型
 *
 * @author ZhaoMn
 */
public enum SortTypeEnum {

  /** 1-ASC 正序排序，0-DESC 倒序排序 */
  ASC("1", "正序排序"),
  DESC("0", "倒序排序"),
  ;

  private final String code;
  private final String notes;

  SortTypeEnum(String code, String notes) {
    this.code = code;
    this.notes = notes;
  }

  public String getCode() {
    return code;
  }

  public String getNotes() {
    return notes;
  }

  public static SortTypeEnum ofValue(String code) {
    if(null == code){
      return null;
    }
    for (SortTypeEnum investor : SortTypeEnum.values()) {
      if (investor.getCode().equals(code)) {
        return investor;
      }
    }
    return null;
  }
}
