withOptions method

  1. @override
NQuadsCodec withOptions({
  1. RdfGraphEncoderOptions? encoder,
  2. RdfGraphDecoderOptions? decoder,
  3. IriTermFactory? iriTermFactory,
})
override

Creates a new codec instance with the specified options

This method returns a new instance of the codec configured with the provided encoder and decoder options. The original codec instance remains unchanged.

The encoder parameter contains optional encoder options to customize encoding behavior. The decoder parameter contains optional decoder options to customize decoding behavior.

Returns a new RdfDatasetCodec instance with the specified options applied.

This follows the immutable configuration pattern, allowing for clean method chaining and configuration without side effects.

Implementation

@override
NQuadsCodec withOptions({
  RdfGraphEncoderOptions? encoder,
  RdfGraphDecoderOptions? decoder,
  IriTermFactory? iriTermFactory,
}) {
  return NQuadsCodec(
      encoderOptions: NQuadsEncoderOptions.from(encoder ?? _encoderOptions),
      decoderOptions: NQuadsDecoderOptions.from(decoder ?? _decoderOptions),
      iriTermFactory: iriTermFactory ?? _iriTermFactory);
}