org.omnaest.utils.structure.map
Class MapDelta<K,V>

java.lang.Object
  extended by org.omnaest.utils.structure.map.MapDelta<K,V>
Type Parameters:
K -
V -

public class MapDelta<K,V>
extends Object

A MapDelta will calculate the SetDelta of the Map.keySet() and the delta between the values of the retained keyset.

Author:
Omnaest
See Also:
MapUtils.delta(Map, Map), SetUtils.delta(Set, Set)

Nested Class Summary
static class MapDelta.Values<V>
          Holds the value of the first and second map
 
Constructor Summary
MapDelta(Map<K,V> firstMap, Map<K,V> secondMap)
           
 
Method Summary
 boolean equals(Object obj)
           
 SetDelta<K> getKeySetDelta()
          Returns the SetDelta of the Map.keySet()
 Map<K,V> getRetainedKeyToEqualValueMap()
          Returns a Map with all retained keys between the first and second map which have not changed their value
 Map<K,MapDelta.Values<V>> getRetainedKeyToUnequalValuesMap()
          Returns a Map with all retained keys between the first and second map which have changed their value
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapDelta

public MapDelta(Map<K,V> firstMap,
                Map<K,V> secondMap)
Parameters:
firstMap -
secondMap -
See Also:
MapDelta
Method Detail

getRetainedKeyToUnequalValuesMap

public Map<K,MapDelta.Values<V>> getRetainedKeyToUnequalValuesMap()
Returns a Map with all retained keys between the first and second map which have changed their value

Returns:
See Also:
MapDelta.Values

getRetainedKeyToEqualValueMap

public Map<K,V> getRetainedKeyToEqualValueMap()
Returns a Map with all retained keys between the first and second map which have not changed their value

Returns:

getKeySetDelta

public SetDelta<K> getKeySetDelta()
Returns the SetDelta of the Map.keySet()

Returns:
See Also:
SetDelta

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All Rights Reserved.