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,
})

Returns a copy of the target configuration.

  • host: IP or Domain.
  • protocol: ICMP, TCP, HTTP, or HTTPS.
  • isEssential: If true, failure of this target triggers the circuit breaker.

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,
  );
}