Table of Contents

Class AnyPattern<T>

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern that accepts any instance of the provided type.

public sealed record AnyPattern<T> : Pattern<T?>, IEquatable<Pattern>, IEquatable<Pattern<T?>>, IEquatable<AnyPattern<T>>

Type Parameters

T

The type of values to match.

Inheritance
AnyPattern<T>
Implements
Inherited Members

Constructors

AnyPattern()

public AnyPattern()

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Instance

Gets the singleton instance of the pattern.

public static AnyPattern<T> Instance { get; }

Property Value

AnyPattern<T>

IsAny

Gets a value indicating this pattern matches any object of the intended type.

public override bool IsAny { get; }

Property Value

bool

Methods

Equals(AnyPattern<T>?)

public bool Equals(AnyPattern<T>? other)

Parameters

other AnyPattern<T>

Returns

bool

Equals(Pattern<T?>?)

public override sealed bool Equals(Pattern<T?>? other)

Parameters

other Pattern<T>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(T?, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<T?> Match(T? input, MatchingContext context)

Parameters

input T

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<T>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(AnyPattern<T>?, AnyPattern<T>?)

public static bool operator ==(AnyPattern<T>? left, AnyPattern<T>? right)

Parameters

left AnyPattern<T>
right AnyPattern<T>

Returns

bool

operator !=(AnyPattern<T>?, AnyPattern<T>?)

public static bool operator !=(AnyPattern<T>? left, AnyPattern<T>? right)

Parameters

left AnyPattern<T>
right AnyPattern<T>

Returns

bool