This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 12e5fc90f3 [INLONG-9070][Manager] Add MessageWrapType.forType method 
for MessageWrapType (#9071)
12e5fc90f3 is described below

commit 12e5fc90f315d6131aceadeadbe1405b7cbe7769
Author: fuweng11 <[email protected]>
AuthorDate: Wed Oct 18 17:41:28 2023 +0800

    [INLONG-9070][Manager] Add MessageWrapType.forType method for 
MessageWrapType (#9071)
---
 .../java/org/apache/inlong/common/enums/MessageWrapType.java  | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git 
a/inlong-common/src/main/java/org/apache/inlong/common/enums/MessageWrapType.java
 
b/inlong-common/src/main/java/org/apache/inlong/common/enums/MessageWrapType.java
index 159c081c56..8733858c2d 100644
--- 
a/inlong-common/src/main/java/org/apache/inlong/common/enums/MessageWrapType.java
+++ 
b/inlong-common/src/main/java/org/apache/inlong/common/enums/MessageWrapType.java
@@ -17,6 +17,8 @@
 
 package org.apache.inlong.common.enums;
 
+import java.util.Objects;
+
 /**
  * Enumeration class of encoding format of data output from DataProxy to MQ
  */
@@ -58,6 +60,15 @@ public enum MessageWrapType {
         return UNKNOWN;
     }
 
+    public static MessageWrapType forType(String type) {
+        for (MessageWrapType msgEncType : MessageWrapType.values()) {
+            if (Objects.equals(msgEncType.getName(), type)) {
+                return msgEncType;
+            }
+        }
+        return UNKNOWN;
+    }
+
     private final int id;
     private final String name;
     private final String desc;

Reply via email to