Package com.google.common.collect
Interface MapDifference<K,V>
- All Known Subinterfaces:
SortedMapDifference<K,
V>
- All Known Implementing Classes:
Maps.MapDifferenceImpl
,Maps.SortedMapDifferenceImpl
public interface MapDifference<K,V>
An object representing the differences between two maps.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A difference between the mappings from two maps with the same key. -
Method Summary
Modifier and TypeMethodDescriptionboolean
areEqual()
Returnstrue
if there are no differences between the two maps; that is, if the maps are equal.Returns an unmodifiable map describing keys that appear in both maps, but with different values.Returns an unmodifiable map containing the entries that appear in both maps; that is, the intersection of the two maps.Returns an unmodifiable map containing the entries from the left map whose keys are not present in the right map.Returns an unmodifiable map containing the entries from the right map whose keys are not present in the left map.boolean
Compares the specified object with this instance for equality.int
hashCode()
Returns the hash code for this instance.
-
Method Details
-
areEqual
boolean areEqual()Returnstrue
if there are no differences between the two maps; that is, if the maps are equal. -
entriesOnlyOnLeft
Returns an unmodifiable map containing the entries from the left map whose keys are not present in the right map. -
entriesOnlyOnRight
Returns an unmodifiable map containing the entries from the right map whose keys are not present in the left map. -
entriesInCommon
Returns an unmodifiable map containing the entries that appear in both maps; that is, the intersection of the two maps. -
entriesDiffering
Map<K,MapDifference.ValueDifference<V>> entriesDiffering()Returns an unmodifiable map describing keys that appear in both maps, but with different values. -
equals
Compares the specified object with this instance for equality. Returnstrue
if the given object is also aMapDifference
and the values returned by theentriesOnlyOnLeft()
,entriesOnlyOnRight()
,entriesInCommon()
andentriesDiffering()
of the two instances are equal. -
hashCode
int hashCode()Returns the hash code for this instance. This is defined as the hash code ofArrays.asList(entriesOnlyOnLeft(), entriesOnlyOnRight(), entriesInCommon(), entriesDiffering())
-