Files
git.stella-ops.org/src/Concelier/__Libraries/StellaOps.Concelier.Merge/Comparers/VersionComparisonResult.cs
2026-02-01 21:37:40 +02:00

39 lines
1.3 KiB
C#

using StellaOps.VersionComparison;
using System.Collections.Immutable;
namespace StellaOps.Concelier.Merge.Comparers;
/// <summary>
/// Result of a version comparison with explainability proof lines.
/// </summary>
/// <param name="Comparison">Negative if left &lt; right, zero if equal, positive if left &gt; right.</param>
/// <param name="ProofLines">Human-readable explanation of comparison steps.</param>
/// <param name="Comparator">The comparator type used.</param>
public sealed record VersionComparisonResult(
int Comparison,
ImmutableArray<string> ProofLines,
ComparatorType Comparator)
{
/// <summary>
/// True if the left version is less than the right version.
/// </summary>
public bool IsLessThan => Comparison < 0;
/// <summary>
/// True if the left version equals the right version.
/// </summary>
public bool IsEqual => Comparison == 0;
/// <summary>
/// True if the left version is greater than the right version.
/// </summary>
public bool IsGreaterThan => Comparison > 0;
/// <summary>
/// True if the left version is greater than or equal to the right version.
/// Useful for checking if installed >= fixed.
/// </summary>
public bool IsGreaterThanOrEqual => Comparison >= 0;
}