withOptions method

  1. @override
RdfGraphEncoder withOptions(
  1. RdfGraphEncoderOptions options
)
override

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:

Returns:

  • A new encoder instance with the specified options applied.

Implementation

@override
RdfGraphEncoder withOptions(RdfGraphEncoderOptions options) {
  var opts = options is NTriplesEncoderOptions
      ? options
      : NTriplesEncoderOptions.from(options);
  return opts == this._options ? this : NTriplesEncoder(options: opts);
}