copyWith method

  1. @override
JsonLdEncoderOptions copyWith({
  1. Map<String, String>? customPrefixes,
  2. bool? generateMissingPrefixes,
  3. bool? includeBaseDeclaration,
  4. IriRelativizationOptions? iriRelativization,
})
override

Creates a copy of this options instance with the specified overrides.

This method follows the copyWith pattern commonly used in Dart for creating modified copies of immutable objects while preserving the original instance.

Parameters:

  • customPrefixes New custom prefixes to use. If null, the current value is retained.
  • iriRelativization New relativization options. If null, the current value is retained.

Returns:

Implementation

@override
JsonLdEncoderOptions copyWith(
        {Map<String, String>? customPrefixes,
        bool? generateMissingPrefixes,
        bool? includeBaseDeclaration,
        IriRelativizationOptions? iriRelativization}) =>
    JsonLdEncoderOptions(
      customPrefixes: customPrefixes ?? this.customPrefixes,
      generateMissingPrefixes:
          generateMissingPrefixes ?? this.generateMissingPrefixes,
      includeBaseDeclaration:
          includeBaseDeclaration ?? this.includeBaseDeclaration,
      iriRelativization: iriRelativization ?? this.iriRelativization,
    );