Table of Contents

Class NullPattern<T>

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on null instances of the provided type.

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

Type Parameters

T

The type of values to match.

Inheritance
NullPattern<T>
Implements
Inherited Members

Constructors

NullPattern()

public NullPattern()

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Instance

Gets the singleton instance of the NullPattern<T> class.

public static NullPattern<T> Instance { get; }

Property Value

NullPattern<T>

Methods

Equals(NullPattern<T>?)

public bool Equals(NullPattern<T>? other)

Parameters

other NullPattern<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 ==(NullPattern<T>?, NullPattern<T>?)

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

Parameters

left NullPattern<T>
right NullPattern<T>

Returns

bool

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

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

Parameters

left NullPattern<T>
right NullPattern<T>

Returns

bool