@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; }
builder.append("Modified Properties: "); diffProperties.forEach((k, v) -> { builder.append("[ " + k + ", " + v.leftValue() + "-->" + v.rightValue() + "], "); });
@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 Map<String, Boolean> getUpdateMap(final Map<String, MapDifference.ValueDifference<Boolean>> diffMap) { final Map<String, Boolean> updates = Maps.newHashMap(); for (Map.Entry<String, MapDifference.ValueDifference<Boolean>> entry : diffMap.entrySet()) { updates.put(entry.getKey(), entry.getValue().rightValue()); } return updates; }
@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; }
worker.conflictingRemoteIdentities.addLast(new IdentityBundle(entry.getKey(), entry.getValue().rightValue()));
json.name(ATTRIBUTE_PARAMS).beginObject(); for (Entry<String, ValueDifference<String>> valueDiff : value.paramDifference().entriesDiffering().entrySet()) { json.prop(valueDiff.getKey(), valueDiff.getValue().rightValue());
private void saveChangesToAssignmentTable(Map<String, String> assignments, Map<String, String> newAssignments) throws RollUpException { MapDifference<String, String> diff = Maps.difference(assignments, newAssignments); if (!diff.areEqual()) { Map<String, String> remove = diff.entriesOnlyOnLeft(); Map<String, String> add = diff.entriesOnlyOnRight(); Map<String, ValueDifference<String>> entryDifferences = diff.entriesDiffering(); if (!remove.isEmpty()) { assignmentStore.removeAssignments(remove.keySet()); } for (String id : add.keySet()) { assignmentStore.setAssignment(id, add.get(id)); } for (String id : entryDifferences.keySet()) { assignmentStore.removeAssignments(ImmutableSet.of(id)); assignmentStore.setAssignment(id, entryDifferences.get(id).rightValue()); } } }
@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; }