Interface IFixedWidthLoaderBuilder<T>

Namespace
Wolfgang.Etl.FixedWidth
Assembly
Wolfgang.Etl.FixedWidth.dll

A fluent builder for a fixed-width loader that terminates a generic Wolfgang.Etl.Abstractions.EtlPipeline. Returned by the FixedWidthLoader sink terminators in EtlPipelineFixedWidthExtensions.

public interface IFixedWidthLoaderBuilder<T> : IEtlPipelineSink where T : notnull

Type Parameters

T

The record type consumed by the loader.

Inherited Members

Remarks

Each configuration method maps one-to-one to a settable property on FixedWidthLoader<TRecord> and returns the same builder so calls chain. Because the builder is an Wolfgang.Etl.Abstractions.IEtlPipelineSink, the loader is materialized and the pipeline runs when RunAsync(IProgress<EtlPipelineProgress>, CancellationToken) is called.

Methods

Encoding(Encoding)

Sets the text encoding used to encode the output. Applies only to the path- and stream-based terminators; a caller-supplied writer already carries its own encoding. Defaults to UTF8.

IFixedWidthLoaderBuilder<T> Encoding(Encoding encoding)

Parameters

encoding Encoding

The encoding to write with.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

FieldDelimiter(string?)

Sets FieldDelimiter — a string written between adjacent fields on every line, or null for pure fixed-width output.

IFixedWidthLoaderBuilder<T> FieldDelimiter(string? delimiter)

Parameters

delimiter string

The field delimiter, or null for none.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

FieldSeparator(char?)

Sets FieldSeparator — when non-null (and a header is written), a separator line of the given character is written after the header.

IFixedWidthLoaderBuilder<T> FieldSeparator(char? separator)

Parameters

separator char?

The separator character, or null for none.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

HeaderConverter(Func<string, FieldContext, string>)

Sets HeaderConverter — the delegate that renders a header label to its string form. Only used when WriteHeader(bool) is enabled.

IFixedWidthLoaderBuilder<T> HeaderConverter(Func<string, FieldContext, string> converter)

Parameters

converter Func<string, FieldContext, string>

The header converter.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

IsDryRun(bool)

Sets IsDryRun — when enabled the pipeline runs and validates but writes nothing to the output.

IFixedWidthLoaderBuilder<T> IsDryRun(bool isDryRun)

Parameters

isDryRun bool

true to run without writing output.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

ValueConverter(Func<object, FieldContext, string>)

Sets ValueConverter — the delegate that renders a field value to its string form before padding.

IFixedWidthLoaderBuilder<T> ValueConverter(Func<object, FieldContext, string> converter)

Parameters

converter Func<object, FieldContext, string>

The value converter.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.

WriteHeader(bool)

Sets WriteHeader — whether a header line is written before the records.

IFixedWidthLoaderBuilder<T> WriteHeader(bool writeHeader)

Parameters

writeHeader bool

true to write a header line.

Returns

IFixedWidthLoaderBuilder<T>

The same builder, for chaining.