Class Maps.MapDifferenceImpl<K,​V>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • onlyOnLeft

        final java.util.Map<K,​V> onlyOnLeft
      • onlyOnRight

        final java.util.Map<K,​V> onlyOnRight
      • onBoth

        final java.util.Map<K,​V> onBoth
    • Constructor Detail

      • MapDifferenceImpl

        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)
    • Method Detail

      • areEqual

        public boolean areEqual()
        Description copied from interface: MapDifference
        Returns true if there are no differences between the two maps; that is, if the maps are equal.
        Specified by:
        areEqual in interface MapDifference<K,​V>
      • entriesOnlyOnLeft

        public java.util.Map<K,​V> entriesOnlyOnLeft()
        Description copied from interface: MapDifference
        Returns an unmodifiable map containing the entries from the left map whose keys are not present in the right map.
        Specified by:
        entriesOnlyOnLeft in interface MapDifference<K,​V>
      • entriesOnlyOnRight

        public java.util.Map<K,​V> entriesOnlyOnRight()
        Description copied from interface: MapDifference
        Returns an unmodifiable map containing the entries from the right map whose keys are not present in the left map.
        Specified by:
        entriesOnlyOnRight in interface MapDifference<K,​V>
      • entriesInCommon

        public java.util.Map<K,​V> entriesInCommon()
        Description copied from interface: MapDifference
        Returns an unmodifiable map containing the entries that appear in both maps; that is, the intersection of the two maps.
        Specified by:
        entriesInCommon in interface MapDifference<K,​V>
      • hashCode

        public int hashCode()
        Description copied from interface: MapDifference
        Returns the hash code for this instance. This is defined as the hash code of
        
         Arrays.asList(entriesOnlyOnLeft(), entriesOnlyOnRight(),
             entriesInCommon(), entriesDiffering())
         
        Specified by:
        hashCode in interface MapDifference<K,​V>
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object