java.lang.Object
org.litebridgedb.tracking.ChangedField
org.litebridgedb.tracking.ChangedMapField
Map-specific type of ChangedField which holds a snapshot of the original underlying map.
This class is a final implementation that provides additional functionality
for handling changes to Map-type fields.
It inherits the common properties and behavior from the ChangedField class
and extends it by including a snapshot of the original map associated with the field.
It ensures that the map snapshot is immutable.
-
Field Summary
Fields inherited from class org.litebridgedb.tracking.ChangedField
name, value -
Constructor Summary
ConstructorsConstructorDescriptionChangedMapField(String fieldName, @Nullable Object value, @Nullable Map<?, Integer> mapSnapshot) Construct aChangedMapFieldinstance representing a change in a map field, including a snapshot of its original state as an immutable map. -
Method Summary
Methods inherited from class org.litebridgedb.tracking.ChangedField
cast, name, value
-
Constructor Details
-
ChangedMapField
public ChangedMapField(String fieldName, @Nullable Object value, @Nullable Map<?, Integer> mapSnapshot) Construct aChangedMapFieldinstance representing a change in a map field, including a snapshot of its original state as an immutable map.- Parameters:
fieldName- the name of the field being trackedvalue- the new value of the fieldmapSnapshot- the original state of the map field, stored as an immutable map
-
-
Method Details
-
mapSnapshot
Retrieve the snapshot of the original map associated with this field.- Returns:
- an immutable
Mapcontaining the snapshot of the original map, where keys are of an unspecified type and values are integers.
-
equals
- Overrides:
equalsin classChangedField
-
hashCode
public int hashCode()- Overrides:
hashCodein classChangedField
-
toString
- Overrides:
toStringin classChangedField
-