chia7712 commented on code in PR #23581:
URL: https://github.com/apache/kafka/pull/23581#discussion_r4659140138
##########
server/src/main/java/org/apache/kafka/server/ProcessRole.java:
##########
@@ -27,6 +29,15 @@ public enum ProcessRole {
this.roleName = roleName;
}
+ public static ProcessRole fromString(String role) {
+ return switch (role) {
Review Comment:
I was thinking about using `values()`, but it doesn't taste much better :)
Just sharing, not a blocker.
```java
for (ProcessRole processRole : values()) {
if (processRole.roleName.equals(role)) {
return processRole;
}
}
throw new ConfigException(...);
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]