Committed by
Gerrit Code Review
Add map name to equals() and toString() calculations
Change-Id: If7a2a14f56db7cc856d73d69f6b289f0df5cca71
Showing
2 changed files
with
7 additions
and
1 deletions
| ... | @@ -103,7 +103,8 @@ public final class EventuallyConsistentMapEvent<K, V> { | ... | @@ -103,7 +103,8 @@ public final class EventuallyConsistentMapEvent<K, V> { |
| 103 | EventuallyConsistentMapEvent that = (EventuallyConsistentMapEvent) o; | 103 | EventuallyConsistentMapEvent that = (EventuallyConsistentMapEvent) o; |
| 104 | return Objects.equals(this.type, that.type) && | 104 | return Objects.equals(this.type, that.type) && |
| 105 | Objects.equals(this.key, that.key) && | 105 | Objects.equals(this.key, that.key) && |
| 106 | - Objects.equals(this.value, that.value); | 106 | + Objects.equals(this.value, that.value) && |
| 107 | + Objects.equals(this.name, that.name); | ||
| 107 | } | 108 | } |
| 108 | 109 | ||
| 109 | @Override | 110 | @Override |
| ... | @@ -114,6 +115,7 @@ public final class EventuallyConsistentMapEvent<K, V> { | ... | @@ -114,6 +115,7 @@ public final class EventuallyConsistentMapEvent<K, V> { |
| 114 | @Override | 115 | @Override |
| 115 | public String toString() { | 116 | public String toString() { |
| 116 | return MoreObjects.toStringHelper(getClass()) | 117 | return MoreObjects.toStringHelper(getClass()) |
| 118 | + .add("name", name) | ||
| 117 | .add("type", type) | 119 | .add("type", type) |
| 118 | .add("key", key) | 120 | .add("key", key) |
| 119 | .add("value", value) | 121 | .add("value", value) | ... | ... |
| ... | @@ -42,6 +42,9 @@ public class EventuallyConsistentMapEventTest { | ... | @@ -42,6 +42,9 @@ public class EventuallyConsistentMapEventTest { |
| 42 | new EventuallyConsistentMapEvent<>("map1", PUT, "k1", "v2"); | 42 | new EventuallyConsistentMapEvent<>("map1", PUT, "k1", "v2"); |
| 43 | EventuallyConsistentMapEvent<String, String> event5 = | 43 | EventuallyConsistentMapEvent<String, String> event5 = |
| 44 | new EventuallyConsistentMapEvent<>("map2", REMOVE, "k1", "v2"); | 44 | new EventuallyConsistentMapEvent<>("map2", REMOVE, "k1", "v2"); |
| 45 | + EventuallyConsistentMapEvent<String, String> event6 = | ||
| 46 | + new EventuallyConsistentMapEvent<>("map3", REMOVE, "k1", "v2"); | ||
| 47 | + | ||
| 45 | 48 | ||
| 46 | /** | 49 | /** |
| 47 | * Checks the equals(), hashCode() and toString() operations. | 50 | * Checks the equals(), hashCode() and toString() operations. |
| ... | @@ -54,6 +57,7 @@ public class EventuallyConsistentMapEventTest { | ... | @@ -54,6 +57,7 @@ public class EventuallyConsistentMapEventTest { |
| 54 | .addEqualityGroup(event3) | 57 | .addEqualityGroup(event3) |
| 55 | .addEqualityGroup(event4) | 58 | .addEqualityGroup(event4) |
| 56 | .addEqualityGroup(event5) | 59 | .addEqualityGroup(event5) |
| 60 | + .addEqualityGroup(event6) | ||
| 57 | .testEquals(); | 61 | .testEquals(); |
| 58 | } | 62 | } |
| 59 | 63 | ... | ... |
-
Please register or login to post a comment