Class NodeInfoVersion
Version of a server.
public sealed record NodeInfoVersion : IEquatable<NodeInfoVersion>
- Inheritance
-
NodeInfoVersion
- Implements
- Inherited Members
Remarks
The semver string is always bound, enforced by the connection gate (which rejects a server reporting none) and not by this model, so a version object without it would parse with a null Semver outside the gate.
The numeric members carry the base version only, a Lavalink dev build reports zeros there. A NodeLink dev build's pre-release tag lives in PreReleaseIdentifiers, never in the numbers, and the string carries the pre-release and build metadata too.
Properties
Major
Major version, a Lavalink dev build reports zero.
[JsonPropertyName("major")]
[JsonInclude]
public int? Major { get; }
Property Value
- int?
Minor
Minor version, a Lavalink dev build reports zero.
[JsonPropertyName("minor")]
[JsonInclude]
public int? Minor { get; }
Property Value
- int?
Parsed
The version parsed from Semver, null when it does not parse, such as a dev build's commit hash.
[JsonIgnore]
public NodeVersion? Parsed { get; }
Property Value
Patch
Patch version, a Lavalink dev build reports zero.
[JsonPropertyName("patch")]
[JsonInclude]
public int? Patch { get; }
Property Value
- int?
PreRelease
Pre-release identifier.
[JsonPropertyName("preRelease")]
[JsonInclude]
public string? PreRelease { get; }
Property Value
Remarks
Lavalink sends an empty string on release builds, so null and "" both occur and a
non-null test reads true on a release build. Lavalink only. NodeLink reports the array PreReleaseIdentifiers instead.
PreReleaseIdentifiers
The pre-release identifiers, null entries the wire carries are dropped, a null list reads as empty.
[JsonPropertyName("prerelease")]
[JsonInclude]
public IReadOnlyList<string> PreReleaseIdentifiers { get; }
Property Value
Semver
The semantic version of the server.
[JsonPropertyName("semver")]
[JsonInclude]
public string? Semver { get; }
Property Value
Methods
Equals(NodeInfoVersion?)
Indicates whether both versions carry the same numbers and pre-release identifiers.
public bool Equals(NodeInfoVersion? other)
Parameters
otherNodeInfoVersionThe version to compare with.
Returns
- bool
Whether the members match, the identifiers compared by content.
GetHashCode()
Returns a hash of the scalar members, the identifiers stay out of it.
public override int GetHashCode()
Returns
- int
The hash code.