Adding equals and hashCode to Response
package org.openqa.selenium.remote;
+import java.util.Objects;
+
public class Response {
private volatile Object value;
@@ -67,4 +69,22 @@ public String getSessionId() {
public String toString() {
return String.format("(Response: SessionID: %s, Status: %s, Value: %s)", getSessionId(), getStatus(), getValue());
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof Response)) {
+ return false;
+ }
+
+ Response that = (Response) o;
+ return Objects.equals(value, that.value) &&
+ Objects.equals(sessionId, that.sessionId) &&
+ Objects.equals(status, that.status) &&
+ Objects.equals(state, that.state);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value, sessionId, status, state);
+ }
}
