You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "RocMarshal (via GitHub)" <gi...@apache.org> on 2023/12/13 01:58:09 UTC

Re: [PR] [ISSUE-3046][Improve] Improve streampark-common module base on 3.3 Methods Rule [incubator-streampark]

RocMarshal commented on code in PR #3389:
URL: https://github.com/apache/incubator-streampark/pull/3389#discussion_r1424758930


##########
streampark-common/src/main/java/org/apache/streampark/common/enums/ApplicationType.java:
##########
@@ -43,10 +45,13 @@ public int getType() {
     return type;
   }
 
+  @Nonnull
   public String getName() {
     return name;
   }
 
+  /** switch param use this, can't be null */
+  @Nonnull

Review Comment:
   ```suggestion
     @Nullable
   ``` 
   due to the line `61`



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkK8sRestExposedType.java:
##########
@@ -33,12 +36,13 @@ public enum FlinkK8sRestExposedType {
 
   private final Integer type;
 
-  FlinkK8sRestExposedType(String name, Integer type) {
+  FlinkK8sRestExposedType(@Nonnull String name, @Nonnull Integer type) {
     this.name = name;
     this.type = type;
   }
 
-  public static FlinkK8sRestExposedType of(Integer value) {
+  @Nonnull

Review Comment:
   same as mentioned above



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkRestoreMode.java:
##########
@@ -55,11 +58,13 @@ public int get() {
     this.mode = mode;
   }
 
+  @Nonnull
   public String getName() {
     return this.toString();
   }
 
-  public static FlinkRestoreMode of(Integer value) {
+  @Nullable

Review Comment:
   👍 



##########
streampark-common/src/main/java/org/apache/streampark/common/util/ExceptionUtils.java:
##########
@@ -26,7 +29,8 @@ public class ExceptionUtils {
 
   private ExceptionUtils() {}
 
-  public static String stringifyException(Throwable throwable) {
+  @Nonnull

Review Comment:
   👍 



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkRestoreMode.java:
##########
@@ -55,11 +58,13 @@ public int get() {
     this.mode = mode;
   }
 
+  @Nonnull
   public String getName() {
     return this.toString();
   }
 
-  public static FlinkRestoreMode of(Integer value) {
+  @Nullable

Review Comment:
   👍 



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/ResolveOrder.java:
##########
@@ -30,12 +33,13 @@ public enum ResolveOrder {
 
   private final Integer order;
 
-  ResolveOrder(String name, Integer order) {
+  ResolveOrder(@Nonnull String name, @Nonnull Integer order) {
     this.name = name;
     this.order = order;
   }
 
-  public static ResolveOrder of(Integer value) {
+  @Nullable

Review Comment:
   👍 



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkExecutionMode.java:
##########
@@ -48,12 +51,14 @@ public enum FlinkExecutionMode {
 
   private final String name;
 
-  FlinkExecutionMode(Integer mode, String name) {
+  FlinkExecutionMode(@Nonnull Integer mode, @Nonnull String name) {
     this.mode = mode;
     this.name = name;
   }
 
-  public static FlinkExecutionMode of(Integer value) {
+  /** switch param use this, can't be null */
+  @Nonnull

Review Comment:
   same as mentioned above



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDevelopmentMode.java:
##########
@@ -32,12 +35,14 @@ public enum FlinkDevelopmentMode {
 
   private final Integer mode;
 
-  FlinkDevelopmentMode(String name, Integer mode) {
+  FlinkDevelopmentMode(@Nonnull String name, @Nonnull Integer mode) {
     this.name = name;
     this.mode = mode;
   }
 
-  public static FlinkDevelopmentMode of(Integer value) {
+  /** switch param use this, can't be null */
+  @Nonnull

Review Comment:
   same as mentioned above



##########
streampark-common/src/main/java/org/apache/streampark/common/enums/ResolveOrder.java:
##########
@@ -30,12 +33,13 @@ public enum ResolveOrder {
 
   private final Integer order;
 
-  ResolveOrder(String name, Integer order) {
+  ResolveOrder(@Nonnull String name, @Nonnull Integer order) {
     this.name = name;
     this.order = order;
   }
 
-  public static ResolveOrder of(Integer value) {
+  @Nullable

Review Comment:
   👍 



##########
streampark-common/src/main/java/org/apache/streampark/common/util/ExceptionUtils.java:
##########
@@ -26,7 +29,8 @@ public class ExceptionUtils {
 
   private ExceptionUtils() {}
 
-  public static String stringifyException(Throwable throwable) {
+  @Nonnull

Review Comment:
   👍 



-- 
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: issues-unsubscribe@streampark.apache.org

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