package com.railway.business.baseinfo.domain.enums;

/**
 * 行别
 *
 * @author zhaomn
 */
public enum XingbieEnum {

  /** 行别 */
  SX("sx", "上行"),
  XX("xx", "下行"),
  DX("dx", "单线"),
  ;

  private final String code;
  private final String info;

  XingbieEnum(String code, String info) {
    this.code = code;
    this.info = info;
  }

  public String getCode() {
    return code;
  }

  public String getInfo() {
    return info;
  }

  public static XingbieEnum ofValue(String code) {
    for (XingbieEnum investor : XingbieEnum.values()) {
      if (investor.getCode().equals(code)) {
        return investor;
      }
    }
    return DX;
  }
}
