withOptions method
- RdfGraphEncoderOptions options
Creates a new encoder instance with the specified options.
This method follows the Builder pattern to create a new encoder configured with the given options. It allows for customizing the encoding behavior without modifying the original encoder instance.
Parameters:
options
The encoder options to apply, including RdfDatasetEncoderOptions.customPrefixes for namespace handling.
Returns:
- A new encoder instance with the specified options applied.
Implementation
@override
RdfDatasetEncoder withOptions(RdfGraphEncoderOptions options) =>
switch (options) {
NQuadsEncoderOptions _ =>
this._options == options ? this : NQuadsEncoder(options: options),
_ => NQuadsEncoder(options: NQuadsEncoderOptions.from(options)),
};