Package com.webmethods.rtl.util.obj
Class DifferenceMap
java.lang.Object
com.webmethods.rtl.util.obj.DifferenceMap
- All Implemented Interfaces:
Serializable
Storage to store/obtain instances of the
DifferenceEntry
objects.
Difference map is used when you need to take some actions when something
changed in the system. Difference map allows to describe any types of changes
using simple map-based storage mechanism
DifferenceMap diffMap = new DifferenceMap(); diffMap.put("property", "old value", "new value"); .... DifferenceEntry diffEntry = diffMap.get("property); // do some logic with difference entry if (diffEntry.getOldValue() ...) { }
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all inserted difference entriesprotected void
finalize()
Remove unused outside referencesRetrieve specified difference entry by nameGet additional object reference tight to difference mapboolean
isEmpty()
Returns true if container is emptyiterator()
Returns iterator to all values inside difference storagevoid
put
(DifferenceEntry diffEntry) Put an instance ofDifferenceEntry
to the mapvoid
Put a new entry with the specified difference valuesvoid
putAll
(DifferenceMap map) Joins 2 difference maps togethervoid
setReference
(Serializable reference) Set reference instance object (should beSerializable
) Allows to specify some object tight to particular difference mapint
size()
Returns current quantity of difference entries inside the containertoString()
Provides string presentation of the difference map for the debugging purposes
-
Field Details
-
lineSeparator
-
-
Constructor Details
-
DifferenceMap
public DifferenceMap()Create difference entries storage
-
-
Method Details
-
finalize
Remove unused outside references -
clear
public void clear()Removes all inserted difference entries -
size
public int size()Returns current quantity of difference entries inside the container -
isEmpty
public boolean isEmpty()Returns true if container is empty -
iterator
Returns iterator to all values inside difference storage- Returns:
- Iterator of
DifferenceEntry
objects
-
put
Put a new entry with the specified difference values- Parameters:
name
- Entry nameoldValue
- Old entry valuenewValue
- New entry value
-
put
Put an instance ofDifferenceEntry
to the map- Parameters:
diffEntry
- CreatedDifferenceEntry
instance
-
putAll
Joins 2 difference maps together- Parameters:
map
- Difference map to combine
-
get
Retrieve specified difference entry by name- Parameters:
name
- Entry name to retrieve- Returns:
- Instance of
DifferenceEntry
or null if no entry corresponds to specified name
-
toString
Provides string presentation of the difference map for the debugging purposes -
setReference
Set reference instance object (should beSerializable
) Allows to specify some object tight to particular difference map- Parameters:
reference
- Object instance to serve as an additional data to difference map
-
getReference
Get additional object reference tight to difference map- Returns:
- Object reference if any was assigned
-