MINOR: Add equals/hashCode to ErrorMessage
@@ -18,6 +18,8 @@ package io.confluent.rest.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
+
/**
* Generic JSON error message.
*/
@@ -53,4 +55,22 @@ public class ErrorMessage {
public void setMessage(String message) {
this.message = message;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ErrorMessage that = (ErrorMessage) o;
+ return errorCode == that.errorCode
+ && Objects.equals(message, that.message);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(errorCode, message);
+ }
}
