copyWith method

RouteEntry<T> copyWith({
  1. T? destination,
  2. T? nextHop,
  3. int? cost,
  4. DateTime? lastUpdate,
  5. bool? isDirectlyConnected,
})

Creates a copy with updated values

Implementation

RouteEntry<T> copyWith({
  T? destination,
  T? nextHop,
  int? cost,
  DateTime? lastUpdate,
  bool? isDirectlyConnected,
}) {
  return RouteEntry<T>(
    destination: destination ?? this.destination,
    nextHop: nextHop ?? this.nextHop,
    cost: cost ?? this.cost,
    lastUpdate: lastUpdate ?? this.lastUpdate,
    isDirectlyConnected: isDirectlyConnected ?? this.isDirectlyConnected,
  );
}