You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/11/02 03:14:14 UTC
[inlong] 01/01: [INLONG-6361][Manager] Fix the deserialization exception with Jackson's version below 2.13 (#6362)
This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
commit 70bf3e0aa9332d4a6c3d46535f94ae84cc1af6b9
Author: woofyzhao <49...@qq.com>
AuthorDate: Wed Nov 2 11:09:26 2022 +0800
[INLONG-6361][Manager] Fix the deserialization exception with Jackson's version below 2.13 (#6362)
---
.../org/apache/inlong/manager/common/enums/SortStatus.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/SortStatus.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/SortStatus.java
index 183b2d4a9..c4c66558d 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/SortStatus.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/SortStatus.java
@@ -17,6 +17,7 @@
package org.apache.inlong.manager.common.enums;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
@@ -53,4 +54,14 @@ public enum SortStatus {
return description;
}
+ @JsonCreator
+ public static SortStatus forCode(int code) {
+ for (SortStatus status : values()) {
+ if (status.getCode() == code) {
+ return status;
+ }
+ }
+ throw new IllegalStateException(String.format("Illegal code=%s for SortStatus", code));
+ }
+
}