Class HumlMapping
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
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
Value
The associated value node.
public HumlNode Value { get; init; }
Property Value
Methods
Equals(HumlMapping?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(HumlMapping? other)
Parameters
otherHumlMappingAn object to compare with this object.
Returns
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()