Table of Contents

Class LinksRestriction<T>

Namespace
Foundation.Data.Doublets.Cli.Protocol
Assembly
Foundation.Data.Doublets.Cli.dll

The parts of a link a LinksOperation<T>.Count or LinksOperation<T>.Each asks for; a null part matches any value.

public sealed record LinksRestriction<T> : IEquatable<LinksRestriction<T>> where T : struct, IBinaryInteger<T>, IUnsignedNumber<T>, IMinMaxValue<T>

Type Parameters

T
Inheritance
LinksRestriction<T>
Implements
Inherited Members

Remarks

Matched like the raw links interface matches a query: no parts match every link, (index) one link, (index value) links of that index whose source or target is value, and (index source target) matches part by part. Every link is matched at most once, so a link that uses value as both source and target is counted once, where UnitedMemoryLinks counts its two usages.

Constructors

LinksRestriction(IReadOnlyList<T?>)

The parts of a link a LinksOperation<T>.Count or LinksOperation<T>.Each asks for; a null part matches any value.

public LinksRestriction(IReadOnlyList<T?> Parts)

Parameters

Parts IReadOnlyList<T?>

Remarks

Matched like the raw links interface matches a query: no parts match every link, (index) one link, (index value) links of that index whose source or target is value, and (index source target) matches part by part. Every link is matched at most once, so a link that uses value as both source and target is counted once, where UnitedMemoryLinks counts its two usages.

Fields

AnyPart

The wire spelling of a part that matches any value.

public const string AnyPart = "*"

Field Value

string

Properties

All

Matches every link.

public static LinksRestriction<T> All { get; }

Property Value

LinksRestriction<T>

Parts

public IReadOnlyList<T?> Parts { get; init; }

Property Value

IReadOnlyList<T?>

Methods

Equals(LinksRestriction<T>?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(LinksRestriction<T>? other)

Parameters

other LinksRestriction<T>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Whether link matches this restriction.

public bool Matches(Link<T> link)

Parameters

link Link<T>

Returns

bool

Of(params T?[])

A restriction of the given parts.

public static LinksRestriction<T> Of(params T?[] parts)

Parameters

parts T?[]

Returns

LinksRestriction<T>

ToString()

The restriction as it is sent: (index source target) with * for any part.

public override string ToString()

Returns

string