copyWith method

StringSpec copyWith({
  1. StringFormat? format,
  2. String? pattern,
  3. int? minLength,
  4. int? maxLength,
  5. String? defaultValue,
  6. String? description,
  7. bool? nullable,
  8. List<Object>? examples,
  9. bool? isDeprecated,
})

Creates a copy with the given modifications.

Implementation

StringSpec copyWith({
  StringFormat? format,
  String? pattern,
  int? minLength,
  int? maxLength,
  String? defaultValue,
  String? description,
  bool? nullable,
  List<Object>? examples,
  bool? isDeprecated,
}) =>
    StringSpec(
      format: format ?? this.format,
      pattern: pattern ?? this.pattern,
      minLength: minLength ?? this.minLength,
      maxLength: maxLength ?? this.maxLength,
      defaultValue: defaultValue ?? this.defaultValue,
      description: description ?? this.description,
      nullable: nullable ?? this.nullable,
      examples: examples ?? this.examples,
      isDeprecated: isDeprecated ?? this.isDeprecated,
    );