Package com.google.common.collect
Interface MapDifference<K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
- 
- All Known Subinterfaces:
- SortedMapDifference<K,V>
 
 @DoNotMock("Use Maps.difference") @GwtCompatible public interface MapDifference<K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object> An object representing the differences between two maps.- Since:
- 2.0
- Author:
- Kevin Bourrillion
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceMapDifference.ValueDifference<V extends @Nullable java.lang.Object>A difference between the mappings from two maps with the same key.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanareEqual()Returnstrueif 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.booleanequals(java.lang.Object object)Compares the specified object with this instance for equality.inthashCode()Returns the hash code for this instance.
 
- 
- 
- 
Method Detail- 
areEqualboolean areEqual() Returnstrueif there are no differences between the two maps; that is, if the maps are equal.
 - 
entriesOnlyOnLeftjava.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.
 - 
entriesOnlyOnRightjava.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.
 - 
entriesInCommonjava.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.
 - 
entriesDifferingjava.util.Map<K,MapDifference.ValueDifference<V>> entriesDiffering() Returns an unmodifiable map describing keys that appear in both maps, but with different values.
 - 
equalsboolean equals(@CheckForNull java.lang.Object object) Compares the specified object with this instance for equality. Returnstrueif the given object is also aMapDifferenceand the values returned by theentriesOnlyOnLeft(),entriesOnlyOnRight(),entriesInCommon()andentriesDiffering()of the two instances are equal.- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodeint hashCode() Returns the hash code for this instance. This is defined as the hash code ofArrays.asList(entriesOnlyOnLeft(), entriesOnlyOnRight(), entriesInCommon(), entriesDiffering())- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-