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