Class HumlMapping

Namespace
Huml.Net.Parser
Assembly
Huml.Net.dll

Represents a key-value mapping entry (e.g., key: value).

public sealed record HumlMapping : HumlNode, IEquatable<HumlNode>, IEquatable<HumlMapping>
Inheritance
HumlMapping
Implements
Inherited Members

Remarks

Equality is structural and iterative (see Huml.Net.Parser.HumlNodeEquality): the compiler-generated recursive equality would overflow the stack on deep single-child chains, so it is overridden here.

Constructors

HumlMapping(string, HumlNode)

Represents a key-value mapping entry (e.g., key: value).

public HumlMapping(string Key, HumlNode Value)

Parameters

Key string

The key string for this mapping.

Value HumlNode

The associated value node.

Remarks

Equality is structural and iterative (see Huml.Net.Parser.HumlNodeEquality): the compiler-generated recursive equality would overflow the stack on deep single-child chains, so it is overridden here.

Properties

Key

The key string for this mapping.

public string Key { get; init; }

Property Value

string

Value

The associated value node.

public HumlNode Value { get; init; }

Property Value

HumlNode

Methods

Equals(HumlMapping?)

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

public bool Equals(HumlMapping? other)

Parameters

other HumlMapping

An object to compare with this object.

Returns

bool

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

GetHashCode()

Returns a hash code based only on the runtime type, consistent with the overridden Equals(HumlNode?) that excludes Line and Column. Derived types override this further to incorporate their primary-constructor parameters.

public override int GetHashCode()

Returns

int