Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Unified Diff: talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java

Issue 1193883006: Adding an equals method for KeyValuePair for easier testing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: adding hashCode Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java
diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java b/talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java
index f2b0aedb2a181142c634c110efef24961627e7e1..730df3553d1427082b57edba0d055c3985121d81 100644
--- a/talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java
+++ b/talk/app/webrtc/java/src/org/webrtc/MediaConstraints.java
@@ -56,8 +56,24 @@ public class MediaConstraints {
public String toString() {
return key + ": " + value;
}
- }
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+ if (other == null || getClass() != other.getClass()) {
+ return false;
+ }
+ KeyValuePair that = (KeyValuePair)other;
+ return key.equals(that.key) && value.equals(that.value);
+ }
+
+ @Override
+ public int hashCode() {
+ return key.hashCode() + value.hashCode();
+ }
+ }
public final List<KeyValuePair> mandatory;
public final List<KeyValuePair> optional;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698