copyWith method

NetworkTarget copyWith({
  1. String? label,
  2. String? host,
  3. int? port,
  4. TargetProtocol? protocol,
  5. BigInt? timeoutMs,
  6. int? priority,
  7. bool? isEssential,
})

Creates a copy of NetworkTarget with the given fields replaced by the new values.

label Human-readable identifier. host Domain or IP address. port Destination port. protocol Communication protocol (TCP, ICMP, etc.). timeoutMs Connection timeout. priority Relative priority for sorting. isEssential Criticality flag.

Returns a new NetworkTarget instance.

Implementation

NetworkTarget copyWith({
  String? label,
  String? host,
  int? port,
  TargetProtocol? protocol,
  BigInt? timeoutMs,
  int? priority,
  bool? isEssential,
}) {
  return NetworkTarget(
    label: label ?? this.label,
    host: host ?? this.host,
    port: port ?? this.port,
    protocol: protocol ?? this.protocol,
    timeoutMs: timeoutMs ?? this.timeoutMs,
    priority: priority ?? this.priority,
    isEssential: isEssential ?? this.isEssential,
  );
}