123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- package com.diagbot.client.bean;
- public enum Status {
- /**
- * <code>PENDING = 1;</code>
- *
- * <pre>
- * 操作尚未开始
- * </pre>
- */
- PENDING(1),
- /**
- * <code>RUNNING = 2;</code>
- *
- * <pre>
- * 操作开始
- * </pre>
- */
- RUNNING(2),
- /**
- * <code>OK = 3;</code>
- *
- * <pre>
- * 操作正常结束
- * </pre>
- */
- OK(3),
- /**
- * <code>WARN = 4;</code>
- *
- * <pre>
- * 有警告,但是正常结束
- * </pre>
- */
- WARN(4),
- /**
- * <code>ERROR = 5;</code>
- *
- * <pre>
- * 有错误,但是完整结束
- * </pre>
- */
- ERROR(5),
- /**
- * <code>FAIL = 6;</code>
- *
- * <pre>
- * 操作失败
- * </pre>
- */
- FAIL(6),
- ;
- /**
- * <code>PENDING = 1;</code>
- *
- * <pre>
- * 操作尚未开始
- * </pre>
- */
- public static final int PENDING_VALUE = 1;
- /**
- * <code>RUNNING = 2;</code>
- *
- * <pre>
- * 操作开始
- * </pre>
- */
- public static final int RUNNING_VALUE = 2;
- /**
- * <code>OK = 3;</code>
- *
- * <pre>
- * 操作正常结束
- * </pre>
- */
- public static final int OK_VALUE = 3;
- /**
- * <code>WARN = 4;</code>
- *
- * <pre>
- * 有警告,但是正常结束
- * </pre>
- */
- public static final int WARN_VALUE = 4;
- /**
- * <code>ERROR = 5;</code>
- *
- * <pre>
- * 有错误,但是完整结束
- * </pre>
- */
- public static final int ERROR_VALUE = 5;
- /**
- * <code>FAIL = 6;</code>
- *
- * <pre>
- * 操作失败
- * </pre>
- */
- public static final int FAIL_VALUE = 6;
- public final int getNumber() {
- return value;
- }
- public static Status valueOf(int value) {
- switch (value) {
- case 1:
- return PENDING;
- case 2:
- return RUNNING;
- case 3:
- return OK;
- case 4:
- return WARN;
- case 5:
- return ERROR;
- case 6:
- return FAIL;
- default:
- return null;
- }
- }
- private final int value;
- private Status(int value) {
- this.value = value;
- }
- }
|