Class JoinedNameComparer
Joins two comparers, prioritizing the AltComparer branch.
public record JoinedNameComparer : IMutatableNameComparer, INameComparerThatCanAdd, INameComparerThatCanAddAComparer, INameComparerThatCanRemove, INameComparerThatCanRemoveAComparer, INameComparer, IEquatable<JoinedNameComparer>
- Inheritance
-
JoinedNameComparer
- Implements
- Inherited Members
- Extension Methods
Constructors
JoinedNameComparer(INameComparer, INameComparer)
Joins two comparers, prioritizing the AltComparer branch.
public JoinedNameComparer(INameComparer Comparer, INameComparer AltComparer)
Parameters
ComparerINameComparerAltComparerINameComparer
Properties
AltComparer
public INameComparer AltComparer { get; init; }
Property Value
Comparer
public INameComparer Comparer { get; init; }
Property Value
Methods
Contains(string)
Checks whether this comparer or a child contains the supplied name.
public bool Contains(string name)
Parameters
namestring
Returns
GetDefaultName()
Returns the primary or first registered name used for identification.
public string GetDefaultName()
Returns
Match(ReadOnlySpan<char>, Span<INameComparer>)
Checks whether colName matches this comparer and its parent comparers.
public bool Match(ReadOnlySpan<char> colName, Span<INameComparer> nameComparers)
Parameters
colNameReadOnlySpan<char>The remaining portion of the column name to match.
nameComparersSpan<INameComparer>The preceding chain of comparers to validate against.
Returns
- bool
trueif the full path matches, otherwisefalse.
TryAdd(INameComparer)
Attempts to merge another comparer. Returns the consolidated result if successful, otherwise null.
public INameComparer? TryAdd(INameComparer other)
Parameters
otherINameComparer
Returns
TryAdd(string)
Attempts to add a standard alternative. Returns a new instance if successful, otherwise null.
public INameComparer? TryAdd(string name)
Parameters
namestring
Returns
TryRemove(INameComparer)
Attempts to remove the target comparer. Returns the updated structure if found, otherwise null.
public INameComparer? TryRemove(INameComparer other)
Parameters
otherINameComparer
Returns
TryRemove(string)
Attempts to remove a name. Returns the updated comparer if the name was removed, otherwise null.
public INameComparer? TryRemove(string name)
Parameters
namestring