copyWith method
- Map<
String, String> ? customPrefixes, - bool? generateMissingPrefixes,
- bool? useNumericLocalNames,
- bool? includeBaseDeclaration,
- bool? renderFragmentsAsPrefixed,
- IriRelativizationOptions? iriRelativization,
override
This method allows creating a new TurtleEncoderOptions instance based on the current options, selectively overriding specific fields while keeping all other settings unchanged.
Parameters:
customPrefixes
Optional replacement for the custom namespace prefixesgenerateMissingPrefixes
Optional replacement for the automatic prefix generation settinguseNumericLocalNames
Optional replacement for the numeric local names handling settingincludeBaseDeclaration
Optional replacement for the base declaration inclusion settingrenderFragmentsAsPrefixed
Optional replacement for the fragment rendering setting
Returns:
- A new TurtleEncoderOptions instance with the specified changes applied
Example:
final originalOptions = TurtleEncoderOptions(
generateMissingPrefixes: true,
useNumericLocalNames: false
);
final modifiedOptions = originalOptions.copyWith(
generateMissingPrefixes: false,
customPrefixes: {'ex': 'http://example.org/'}
);
Implementation
@override
TurtleEncoderOptions copyWith(
{Map<String, String>? customPrefixes,
bool? generateMissingPrefixes,
bool? useNumericLocalNames,
bool? includeBaseDeclaration,
bool? renderFragmentsAsPrefixed,
IriRelativizationOptions? iriRelativization}) =>
TurtleEncoderOptions(
customPrefixes: customPrefixes ?? this.customPrefixes,
generateMissingPrefixes:
generateMissingPrefixes ?? this.generateMissingPrefixes,
useNumericLocalNames: useNumericLocalNames ?? this.useNumericLocalNames,
includeBaseDeclaration:
includeBaseDeclaration ?? this.includeBaseDeclaration,
renderFragmentsAsPrefixed:
renderFragmentsAsPrefixed ?? this.renderFragmentsAsPrefixed,
iriRelativization: iriRelativization ?? this.iriRelativization,
);