Skip to main content

Interface IValueObjectSpanNormalizer

Namespace: AdCodicem.ValueObjects
Assembly: AdCodicem.ValueObjects.Abstractions.dll

Declares that a string value object can normalize straight from text, without materializing it first.

public interface IValueObjectSpanNormalizer

Remarks

Implement this alongside on a value object whose underlying type is . Parsing and JSON reading then route through the span overload, so ingesting a value allocates the normalized string and nothing else; without it, the raw text is materialized first and immediately thrown away.

The two overloads must agree. Write the value-typed one as a one-line delegation: public static string NormalizeValue(string value) => NormalizeValue(value.AsSpan());

Methods

NormalizeValue(ReadOnlySpan<char>)

Puts text into its canonical form.

public static abstract string NormalizeValue(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

Text to normalize.

Returns

string

The canonical form of the text.