copyWith method

RedactionConfig copyWith({
  1. bool? enabled,
  2. bool? blockMode,
  3. Map<RedactionLayer, bool>? layerToggles,
  4. List<RegExp>? allowlistRegexes,
  5. double? minEntropy,
  6. int? minLength,
  7. Set<String>? toolAllow,
  8. Set<String>? toolDeny,
})

A copy with the given fields replaced (null = keep current).

Implementation

RedactionConfig copyWith({
  bool? enabled,
  bool? blockMode,
  Map<RedactionLayer, bool>? layerToggles,
  List<RegExp>? allowlistRegexes,
  double? minEntropy,
  int? minLength,
  Set<String>? toolAllow,
  Set<String>? toolDeny,
}) {
  return RedactionConfig(
    enabled: enabled ?? this.enabled,
    blockMode: blockMode ?? this.blockMode,
    layerToggles: layerToggles ?? this.layerToggles,
    allowlistRegexes: allowlistRegexes ?? this.allowlistRegexes,
    minEntropy: minEntropy ?? this.minEntropy,
    minLength: minLength ?? this.minLength,
    toolAllow: toolAllow ?? this.toolAllow,
    toolDeny: toolDeny ?? this.toolDeny,
  );
}