You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2023/02/20 02:53:53 UTC

[incubator-eventmesh] branch master updated: Remove unused setters in enum types

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

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new c03883723 Remove unused setters in enum types
     new 8ec1fc9b3 Merge pull request #3200 from ByteFlow777/master
c03883723 is described below

commit c038837233a4f0bfb00263ed36ecde4bd2cbeca0
Author: Leon Li <by...@gmail.com>
AuthorDate: Sat Feb 18 22:33:30 2023 +0800

    Remove unused setters in enum types
---
 .../apache/eventmesh/common/loadbalance/LoadBalanceType.java | 12 ++----------
 .../apache/eventmesh/common/protocol/SubscriptionMode.java   |  6 +-----
 .../apache/eventmesh/common/protocol/SubscriptionType.java   |  5 +----
 .../eventmesh/common/protocol/grpc/common/StatusCode.java    | 11 ++---------
 .../eventmesh/common/protocol/http/common/ClientRetCode.java | 11 ++---------
 .../eventmesh/common/protocol/http/common/ClientType.java    | 11 ++---------
 .../common/protocol/http/common/EventMeshRetCode.java        | 11 ++---------
 .../common/protocol/http/common/ProtocolVersion.java         |  6 +-----
 .../eventmesh/common/protocol/http/common/RequestCode.java   | 11 ++---------
 .../eventmesh/common/protocol/http/common/RequestURI.java    | 11 ++---------
 .../org/apache/eventmesh/common/protocol/tcp/OPStatus.java   | 11 ++---------
 11 files changed, 19 insertions(+), 87 deletions(-)

diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/loadbalance/LoadBalanceType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/loadbalance/LoadBalanceType.java
index 6096abdf6..b85918b25 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/loadbalance/LoadBalanceType.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/loadbalance/LoadBalanceType.java
@@ -24,8 +24,8 @@ public enum LoadBalanceType {
     WEIGHT_ROUND_ROBIN(1, "weight round robin load balance strategy"),
     WEIGHT_RANDOM(2, "weight random load balance strategy");
 
-    private int code;
-    private String desc;
+    private final int code;
+    private final String desc;
 
     LoadBalanceType(int code, String desc) {
         this.code = code;
@@ -36,16 +36,8 @@ public enum LoadBalanceType {
         return code;
     }
 
-    public void setCode(int code) {
-        this.code = code;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
-
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionMode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionMode.java
index ad4b751a4..7683beee7 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionMode.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionMode.java
@@ -28,7 +28,7 @@ public enum SubscriptionMode {
      */
     CLUSTERING("CLUSTERING");
 
-    private String mode;
+    private final String mode;
 
     SubscriptionMode(String mode) {
         this.mode = mode;
@@ -38,8 +38,4 @@ public enum SubscriptionMode {
         return mode;
     }
 
-    public void setMode(String mode) {
-        this.mode = mode;
-    }
-
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionType.java
index 7efe3089b..996cbfe14 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionType.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/SubscriptionType.java
@@ -27,7 +27,7 @@ public enum SubscriptionType {
      */
     ASYNC("ASYNC");
 
-    private String type;
+    private final String type;
 
     SubscriptionType(String type) {
         this.type = type;
@@ -37,7 +37,4 @@ public enum SubscriptionType {
         return type;
     }
 
-    public void setType(String type) {
-        this.type = type;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/StatusCode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/StatusCode.java
index e7cf9a37f..afcb79460 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/StatusCode.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/StatusCode.java
@@ -44,9 +44,9 @@ public enum StatusCode {
     EVENTMESH_REQUEST_REPLY_MSG_ERR("22", "eventMesh request reply msg err, "),
     CLIENT_RESUBSCRIBE("30", "client needs to resubscribe.");
 
-    private String retCode;
+    private final String retCode;
 
-    private String errMsg;
+    private final String errMsg;
 
     StatusCode(String retCode, String errMsg) {
         this.retCode = retCode;
@@ -57,15 +57,8 @@ public enum StatusCode {
         return retCode;
     }
 
-    public void setRetCode(String retCode) {
-        this.retCode = retCode;
-    }
-
     public String getErrMsg() {
         return errMsg;
     }
 
-    public void setErrMsg(String errMsg) {
-        this.errMsg = errMsg;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientRetCode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientRetCode.java
index ceaf05cef..86f7250a1 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientRetCode.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientRetCode.java
@@ -57,23 +57,16 @@ public enum ClientRetCode {
         return ret;
     }
 
-    private Integer retCode;
+    private final Integer retCode;
 
-    private String errMsg;
+    private final String errMsg;
 
     public Integer getRetCode() {
         return retCode;
     }
 
-    public void setRetCode(Integer retCode) {
-        this.retCode = retCode;
-    }
-
     public String getErrMsg() {
         return errMsg;
     }
 
-    public void setErrMsg(String errMsg) {
-        this.errMsg = errMsg;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientType.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientType.java
index c935da6cc..6cee40077 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientType.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ClientType.java
@@ -23,9 +23,9 @@ public enum ClientType {
 
     SUB(2, "Client for subscribing");
 
-    private Integer type;
+    private final Integer type;
 
-    private String desc;
+    private final String desc;
 
     ClientType(Integer type, String desc) {
         this.type = type;
@@ -57,15 +57,8 @@ public enum ClientType {
         return type;
     }
 
-    public void setType(Integer type) {
-        this.type = type;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/EventMeshRetCode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/EventMeshRetCode.java
index 831eaaca6..bc551a2b4 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/EventMeshRetCode.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/EventMeshRetCode.java
@@ -43,9 +43,9 @@ public enum EventMeshRetCode {
     EVENTMESH_ACL_ERR(22, "eventMesh acl err"),
     EVENTMESH_HTTP_MES_SEND_OVER_LIMIT_ERR(23, "eventMesh http msg send over the limit, ");
 
-    private Integer retCode;
+    private final Integer retCode;
 
-    private String errMsg;
+    private final String errMsg;
 
     EventMeshRetCode(Integer retCode, String errMsg) {
         this.retCode = retCode;
@@ -56,15 +56,8 @@ public enum EventMeshRetCode {
         return retCode;
     }
 
-    public void setRetCode(Integer retCode) {
-        this.retCode = retCode;
-    }
-
     public String getErrMsg() {
         return errMsg;
     }
 
-    public void setErrMsg(String errMsg) {
-        this.errMsg = errMsg;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ProtocolVersion.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ProtocolVersion.java
index acfd65524..23b3decb3 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ProtocolVersion.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/ProtocolVersion.java
@@ -22,7 +22,7 @@ public enum ProtocolVersion {
     V1("1.0"),
     V2("2.0");
 
-    private String version;
+    private final String version;
 
     ProtocolVersion(String version) {
         this.version = version;
@@ -42,10 +42,6 @@ public enum ProtocolVersion {
         return version;
     }
 
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
     public static boolean contains(String version) {
         boolean flag = false;
         for (ProtocolVersion itr : ProtocolVersion.values()) {
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestCode.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestCode.java
index 32e1b7fbc..1d6e351bb 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestCode.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestCode.java
@@ -47,9 +47,9 @@ public enum RequestCode {
 
     ADMIN_SHUTDOWN(601, "ADMIN SHUTDOWN");
 
-    private Integer requestCode;
+    private final Integer requestCode;
 
-    private String desc;
+    private final String desc;
 
     RequestCode(Integer requestCode, String desc) {
         this.requestCode = requestCode;
@@ -82,15 +82,8 @@ public enum RequestCode {
         return requestCode;
     }
 
-    public void setRequestCode(Integer requestCode) {
-        this.requestCode = requestCode;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestURI.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestURI.java
index ff295c30a..da5ebf58b 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestURI.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/common/RequestURI.java
@@ -34,9 +34,9 @@ public enum RequestURI {
     UNSUBSCRIBE_REMOTE("/eventmesh/unsubscribe/remote", "SUBSCRIBE REMOTE");
 
 
-    private String requestURI;
+    private final String requestURI;
 
-    private String desc;
+    private final String desc;
 
     RequestURI(String requestURI, String desc) {
         this.requestURI = requestURI;
@@ -69,15 +69,8 @@ public enum RequestURI {
         return requestURI;
     }
 
-    public void setRequestURI(String requestURI) {
-        this.requestURI = requestURI;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
 }
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/OPStatus.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/OPStatus.java
index 4ecfd04db..b92803b3f 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/OPStatus.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/OPStatus.java
@@ -29,23 +29,16 @@ public enum OPStatus {
         this.desc = desc;
     }
 
-    private Integer code;
+    private final Integer code;
 
-    private String desc;
+    private final String desc;
 
     public Integer getCode() {
         return code;
     }
 
-    public void setCode(Integer code) {
-        this.code = code;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org