Commit 71ebfcd2 by gdj

调整枚举。

parent c35817d3
......@@ -17,7 +17,13 @@ public enum TaskTypeEnum {
TIMED(1),
CONDITIONAL(2);
CONDITIONAL(2),
/**
* 空中下发航线
*/
UNKNOWN(-1),
;
private final int type;
......@@ -33,6 +39,6 @@ public enum TaskTypeEnum {
@JsonCreator
public static TaskTypeEnum find(int type) {
return Arrays.stream(values()).filter(typeEnum -> typeEnum.type == type).findAny()
.orElseThrow(() -> new CloudSDKException(TaskTypeEnum.class, type));
.orElse(UNKNOWN);
}
}
......@@ -14,6 +14,10 @@ import java.util.Arrays;
*/
public enum ErrorCodeSourceEnum {
UNKNOWN(-1),
ZERO(0),
DEVICE(3),
DOCK(5),
......@@ -34,6 +38,7 @@ public enum ErrorCodeSourceEnum {
@JsonCreator
public static ErrorCodeSourceEnum find(int source) {
return Arrays.stream(values()).filter(error -> error.source == source).findAny()
.orElseThrow(() -> new CloudSDKException(ErrorCodeSourceEnum.class, source));
//.orElseThrow(() -> new CloudSDKException(ErrorCodeSourceEnum.class, source));
.orElse(UNKNOWN);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment