copyWith method
A copy with some fields replaced. A null argument keeps the current value, so a correlation id cannot be cleared with this method.
Implementation
@override
EventDTO<T> copyWith({
T? data,
EventKey<T>? key,
Map<String, String>? arguments,
String? correlationId,
}) {
return EventDTOImpl<T>._keyed(
key ?? this.key,
data ?? this.data,
arguments: arguments ?? this.arguments,
correlationId: correlationId ?? this.correlationId,
);
}