You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "healchow (via GitHub)" <gi...@apache.org> on 2023/04/17 12:44:04 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #7869: [INLONG-7867][Manager] Support data validation when importing Excel file

healchow commented on code in PR #7869:
URL: https://github.com/apache/inlong/pull/7869#discussion_r1168630631


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/stream/StreamFieldTypeCellValidator.java:
##########
@@ -38,4 +38,14 @@ public List<String> constraint() {
         return new ArrayList<>(STREAM_FIELD_TYPES);
     }
 
+    @Override
+    public boolean validate(String value) {
+        return STREAM_FIELD_TYPES.contains(value);
+    }
+
+    @Override
+    public String getInvalidTip() {
+        return "StreamField type must one of " + STREAM_FIELD_TYPES;

Review Comment:
   `must one of` -> `must be one of`.
   
   And also, extracting a String constant, then using `String.format()` to append the `STREAM_FIELD_TYPES` maybe is a good practice.



-- 
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@inlong.apache.org

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