@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
private void incrementalUpdate() throws KeeperException { final MapDifference<String, byte[]> difference = Maps.difference(entries.get(), remote, BYTE_ARRAY_EQUIVALENCE); if (difference.areEqual()) { return; } final Map<String, byte[]> newRemote = Maps.newHashMap(remote); final Map<String, byte[]> create = difference.entriesOnlyOnLeft(); final Map<String, ValueDifference<byte[]>> update = difference.entriesDiffering(); final Map<String, byte[]> delete = difference.entriesOnlyOnRight(); log.debug("create: {}", create.keySet()); log.debug("update: {}", update.keySet()); log.debug("delete: {}", delete.keySet()); for (final Map.Entry<String, byte[]> entry : create.entrySet()) { write(entry.getKey(), entry.getValue()); newRemote.put(entry.getKey(), entry.getValue()); } for (final Map.Entry<String, ValueDifference<byte[]>> entry : update.entrySet()) { write(entry.getKey(), entry.getValue().leftValue()); newRemote.put(entry.getKey(), entry.getValue().leftValue()); } for (final Map.Entry<String, byte[]> entry : delete.entrySet()) { delete(entry.getKey()); newRemote.remove(entry.getKey()); } remote = newRemote; }
@Override public boolean equals(@NullableDecl Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference<?>) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference<?>) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@NullableDecl Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference<?>) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference<?>) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference<?>) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
builder.append("Modified Properties: "); diffProperties.forEach((k, v) -> { builder.append("[ " + k + ", " + v.leftValue() + "-->" + v.rightValue() + "], "); });
json.name(ATTRIBUTE_PARAMS).beginObject(); for (Entry<String, ValueDifference<String>> valueDiff : value.paramDifference().entriesDiffering().entrySet()) { json.prop(valueDiff.getKey(), valueDiff.getValue().leftValue());
@Test public void compare_modified_param() { qProfileRules.activateAndCommit(dbSession, left, singleton(RuleActivation.create(xooRule1.getId(), null, ImmutableMap.of("max", "20")))); qProfileRules.activateAndCommit(dbSession, right, singleton(RuleActivation.create(xooRule1.getId(), null, ImmutableMap.of("max", "30")))); QProfileComparisonResult result = comparison.compare(dbSession, left, right); assertThat(result.left().getKee()).isEqualTo(left.getKee()); assertThat(result.right().getKee()).isEqualTo(right.getKee()); assertThat(result.same()).isEmpty(); assertThat(result.inLeft()).isEmpty(); assertThat(result.inRight()).isEmpty(); assertThat(result.modified()).isNotEmpty().containsOnlyKeys(xooRule1.getKey()); assertThat(result.collectRuleKeys()).containsOnly(xooRule1.getKey()); ActiveRuleDiff activeRuleDiff = result.modified().get(xooRule1.getKey()); assertThat(activeRuleDiff.leftSeverity()).isEqualTo(activeRuleDiff.rightSeverity()).isEqualTo(xooRule1.getSeverityString()); assertThat(activeRuleDiff.paramDifference().areEqual()).isFalse(); assertThat(activeRuleDiff.paramDifference().entriesDiffering()).isNotEmpty(); ValueDifference<String> paramDiff = activeRuleDiff.paramDifference().entriesDiffering().get("max"); assertThat(paramDiff.leftValue()).isEqualTo("20"); assertThat(paramDiff.rightValue()).isEqualTo("30"); }
@Override public boolean equals(@NullableDecl Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }