Skip to content

Commit a6e465e

Browse files
committed
Adding equals and hashCode to Response
1 parent ed2d065 commit a6e465e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

java/client/src/org/openqa/selenium/remote/Response.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.openqa.selenium.remote;
1919

20+
import java.util.Objects;
21+
2022
public class Response {
2123

2224
private volatile Object value;
@@ -67,4 +69,22 @@ public String getSessionId() {
6769
public String toString() {
6870
return String.format("(Response: SessionID: %s, Status: %s, Value: %s)", getSessionId(), getStatus(), getValue());
6971
}
72+
73+
@Override
74+
public boolean equals(Object o) {
75+
if (!(o instanceof Response)) {
76+
return false;
77+
}
78+
79+
Response that = (Response) o;
80+
return Objects.equals(value, that.value) &&
81+
Objects.equals(sessionId, that.sessionId) &&
82+
Objects.equals(status, that.status) &&
83+
Objects.equals(state, that.state);
84+
}
85+
86+
@Override
87+
public int hashCode() {
88+
return Objects.hash(value, sessionId, status, state);
89+
}
7090
}

0 commit comments

Comments
 (0)