ElementValueChange<E, V> class
Represents a value change for a specific element within a collection.
This specialized ValueChange associates a value change with a particular element, making it useful for tracking changes to individual items in Collective collections like CollectiveList, CollectiveSet, or CollectiveQueue.
Example:
final element = MyElement();
final change = ElementValueChange(
element: element,
before: 'old value',
after: 'new value'
);
The class provides an unmodifiable variant through ElementValueChange.unmodifiable, which is particularly useful when propagating change notifications through a reactive system.
- Implemented types
-
- ValueChange<
V>
- ValueChange<
Constructors
- ElementValueChange.new({required E element, required V? after, V? before})
- Creates an ElementValueChange recording a change to a specific element.
-
ElementValueChange.unmodifiable(ElementValueChange<
E, V> source) -
Creates an unmodifiable version of an ElementValueChange.
factory
Properties
- after → V?
-
The value after the change occurred.
final
- before → V?
-
The value before the change occurred.
final
- element → E
-
The element that was changed.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
unmodifiable
→ ElementValueChange<
E, V> -
Returns an unmodifiable version of this value change.
latefinal
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override