You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/02/14 01:11:07 UTC

[GitHub] [incubator-seatunnel] simon824 commented on a change in pull request #1214: [hotfix] Add List type check for CheckConfigUtil

simon824 commented on a change in pull request #1214:
URL: https://github.com/apache/incubator-seatunnel/pull/1214#discussion_r805447791



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -72,6 +72,16 @@ public static CheckResult checkAtLeastOneExists(Config config, String... params)
         }
     }
 
+    public static boolean isInvalidParam(Config config, String param) {
+        boolean isInvalidParam = false;
+        if (!config.hasPath(param) || config.getAnyRef(param) == null) {

Review comment:
        what about if key exists, but value is null

##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -72,6 +72,16 @@ public static CheckResult checkAtLeastOneExists(Config config, String... params)
         }
     }
 
+    public static boolean isInvalidParam(Config config, String param) {
+        boolean isInvalidParam = false;
+        if (!config.hasPath(param) || config.getAnyRef(param) == null) {
+            isInvalidParam = true;
+        } else if (config.getAnyRef(param) instanceof List) {

Review comment:
       We can pass in a type parameter.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org