LotSizingDataModel.Instance 2.0.1
Lot-sizing instance representation, descriptors and problem characterization.
Loading...
Searching...
No Matches
UniversalNotationMatchIssue.cs
Go to the documentation of this file.
2
3/// <summary>
4/// Represents one structured explanation emitted by the notation matcher.
5/// </summary>
6public sealed class UniversalNotationMatchIssue
7{
9 string code,
10 string path,
11 string expected,
12 string actual,
13 string message,
14 bool isContradiction)
15 {
16 if (string.IsNullOrWhiteSpace(code))
17 {
18 throw new ArgumentException(
19 "A match issue code is required.",
20 nameof(code));
21 }
22
23 ArgumentNullException.ThrowIfNull(path);
24 ArgumentNullException.ThrowIfNull(expected);
25 ArgumentNullException.ThrowIfNull(actual);
26 ArgumentNullException.ThrowIfNull(message);
27
28 Code = code.Trim();
29 Path = path;
30 Expected = expected;
31 Actual = actual;
32 Message = message;
33 IsContradiction = isContradiction;
34 }
35
36 public string Code { get; }
37 public string Path { get; }
38 public string Expected { get; }
39 public string Actual { get; }
40 public string Message { get; }
41
42 /// <summary>
43 /// Gets whether this issue is a proven contradiction. False means the
44 /// descriptor is currently incomplete for the requested requirement.
45 /// </summary>
46 public bool IsContradiction { get; }
47
48 public override string ToString() =>
49 $"[{Code}] {Path}: expected {Expected}, actual {Actual}. {Message}";
50}
UniversalNotationMatchIssue(string code, string path, string expected, string actual, string message, bool isContradiction)
bool IsContradiction
Gets whether this issue is a proven contradiction. False means the descriptor is currently incomplete...