zoukankan      html  css  js  c++  java
  • 创建枚举

    package net.joystart.vehicle.enums;

    import net.joystart.order.enums.OrderStatus;

    public enum VehicleStatus {  /** 未定义 */  UNDEFINED(-1){public String getName(){return "未定义";}},  /** 可用 */  CANRENT(7){public String getName(){return "可用";}},  /** 已租 */  RENTING(8){public String getName(){return "已租";}},  /** 禁用*/  DISABLED(9){public String getName(){return "禁用";}},  /** 待整备*/  TOREORGANIZE(12){public String getName(){return "待整备";}},  /** 调整中 */  ADJUSTING(13){public String getName(){return "调整中";}},  /** 维修中 */  REPAIRING(14){public String getName(){return "维修中";}},  /** 保养中 */  MAINTAINING(15){public String getName(){return "保养中";}},  /** 换车中 */  CHANGINGVEHICLE(16){public String getName(){return "换车中";}};  private int value;    private VehicleStatus(int value){   this.value=value;  }    public int getValue(){   return this.value;  }    /**   * 根据INT数值获取对应的枚举值   * @param value   * @return   */  public static VehicleStatus valueOf(int value){   switch(value){   case 7:    return CANRENT;   case 8:    return RENTING;   case 9:    return DISABLED;   case 12:    return TOREORGANIZE;   case 13:    return ADJUSTING;   case 14:    return REPAIRING;   case 15:    return MAINTAINING;   case 16:    return CHANGINGVEHICLE;   }   return UNDEFINED;  }    public abstract String getName(); }

  • 相关阅读:
    delphi消息发送字符串
    Delphi2007 在Win10 下运行报错 Assertion failure
    python 定时器
    python 直接赋值 深浅拷贝
    python 闭包
    python 对象
    c++ sizeof和strlen
    c++入门笔记(一)
    python实现四种排序逻辑与代码
    webrtc autotest
  • 原文地址:https://www.cnblogs.com/cuijinlong/p/6651235.html
Copyright © 2011-2022 走看看