Ray Milkey
Committed by Gerrit Code Review

Add map name to equals() and toString() calculations

Change-Id: If7a2a14f56db7cc856d73d69f6b289f0df5cca71
......@@ -103,7 +103,8 @@ public final class EventuallyConsistentMapEvent<K, V> {
EventuallyConsistentMapEvent that = (EventuallyConsistentMapEvent) o;
return Objects.equals(this.type, that.type) &&
Objects.equals(this.key, that.key) &&
Objects.equals(this.value, that.value);
Objects.equals(this.value, that.value) &&
Objects.equals(this.name, that.name);
}
@Override
......@@ -114,6 +115,7 @@ public final class EventuallyConsistentMapEvent<K, V> {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("name", name)
.add("type", type)
.add("key", key)
.add("value", value)
......
......@@ -42,6 +42,9 @@ public class EventuallyConsistentMapEventTest {
new EventuallyConsistentMapEvent<>("map1", PUT, "k1", "v2");
EventuallyConsistentMapEvent<String, String> event5 =
new EventuallyConsistentMapEvent<>("map2", REMOVE, "k1", "v2");
EventuallyConsistentMapEvent<String, String> event6 =
new EventuallyConsistentMapEvent<>("map3", REMOVE, "k1", "v2");
/**
* Checks the equals(), hashCode() and toString() operations.
......@@ -54,6 +57,7 @@ public class EventuallyConsistentMapEventTest {
.addEqualityGroup(event3)
.addEqualityGroup(event4)
.addEqualityGroup(event5)
.addEqualityGroup(event6)
.testEquals();
}
......