mingyen066 commented on code in PR #20346:
URL: https://github.com/apache/kafka/pull/20346#discussion_r2275191518


##########
metadata/src/main/java/org/apache/kafka/controller/BrokerControlStates.java:
##########
@@ -17,37 +17,7 @@
 
 package org.apache.kafka.controller;
 
-import java.util.Objects;
-
-
-class BrokerControlStates {
-    private final BrokerControlState current;
-    private final BrokerControlState next;
-
-    BrokerControlStates(BrokerControlState current, BrokerControlState next) {
-        this.current = current;
-        this.next = next;
-    }
-
-    BrokerControlState current() {
-        return current;
-    }
-
-    BrokerControlState next() {
-        return next;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(current, next);
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (!(o instanceof BrokerControlStates other)) return false;
-        return other.current == current && other.next == next;
-    }
-
+record BrokerControlStates(BrokerControlState current, BrokerControlState 
next) {
     @Override

Review Comment:
   Why not remove toString as well? As far as I know, the only difference is 
that the parentheses become square brackets.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to