static class Maps.MapDifferenceImpl<K,V> extends java.lang.Object implements MapDifference<K,V>
MapDifference.ValueDifference<V>| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Map<K,MapDifference.ValueDifference<V>> |
differences |
(package private) java.util.Map<K,V> |
onBoth |
(package private) java.util.Map<K,V> |
onlyOnLeft |
(package private) java.util.Map<K,V> |
onlyOnRight |
| Constructor and Description |
|---|
MapDifferenceImpl(java.util.Map<K,V> onlyOnLeft,
java.util.Map<K,V> onlyOnRight,
java.util.Map<K,V> onBoth,
java.util.Map<K,MapDifference.ValueDifference<V>> differences) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areEqual()
Returns
true if there are no differences between the two maps; that is, if the maps are
equal. |
java.util.Map<K,MapDifference.ValueDifference<V>> |
entriesDiffering()
Returns an unmodifiable map describing keys that appear in both maps, but with different
values.
|
java.util.Map<K,V> |
entriesInCommon()
Returns an unmodifiable map containing the entries that appear in both maps; that is, the
intersection of the two maps.
|
java.util.Map<K,V> |
entriesOnlyOnLeft()
Returns an unmodifiable map containing the entries from the left map whose keys are not present
in the right map.
|
java.util.Map<K,V> |
entriesOnlyOnRight()
Returns an unmodifiable map containing the entries from the right map whose keys are not
present in the left map.
|
boolean |
equals(java.lang.Object object)
Compares the specified object with this instance for equality.
|
int |
hashCode()
Returns the hash code for this instance.
|
java.lang.String |
toString() |
final java.util.Map<K,MapDifference.ValueDifference<V>> differences
public boolean areEqual()
MapDifferencetrue if there are no differences between the two maps; that is, if the maps are
equal.areEqual in interface MapDifference<K,V>public java.util.Map<K,V> entriesOnlyOnLeft()
MapDifferenceentriesOnlyOnLeft in interface MapDifference<K,V>public java.util.Map<K,V> entriesOnlyOnRight()
MapDifferenceentriesOnlyOnRight in interface MapDifference<K,V>public java.util.Map<K,V> entriesInCommon()
MapDifferenceentriesInCommon in interface MapDifference<K,V>public java.util.Map<K,MapDifference.ValueDifference<V>> entriesDiffering()
MapDifferenceentriesDiffering in interface MapDifference<K,V>public boolean equals(@CheckForNull
java.lang.Object object)
MapDifferencetrue if the
given object is also a MapDifference and the values returned by the MapDifference.entriesOnlyOnLeft(), MapDifference.entriesOnlyOnRight(), MapDifference.entriesInCommon() and MapDifference.entriesDiffering() of the two instances are equal.equals in interface MapDifference<K,V>equals in class java.lang.Objectpublic int hashCode()
MapDifference
Arrays.asList(entriesOnlyOnLeft(), entriesOnlyOnRight(),
entriesInCommon(), entriesDiffering())
hashCode in interface MapDifference<K,V>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object