-
-
Notifications
You must be signed in to change notification settings - Fork 725
/
AggregateInfo.cs
41 lines (31 loc) · 1.08 KB
/
AggregateInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace HotChocolate.Types.Analyzers.Inspectors;
public sealed class AggregateInfo : ISyntaxInfo, IEquatable<AggregateInfo>
{
private readonly IReadOnlyList<ISyntaxInfo> _syntaxInfos;
public AggregateInfo(IReadOnlyList<ISyntaxInfo> syntaxInfos)
{
_syntaxInfos = syntaxInfos;
}
public IReadOnlyList<ISyntaxInfo> Items => _syntaxInfos;
public bool Equals(AggregateInfo? other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return Equals(_syntaxInfos, other._syntaxInfos);
}
public override bool Equals(object? obj)
=> ReferenceEquals(this, obj) ||
obj is AggregateInfo other && Equals(other);
public override int GetHashCode()
=> _syntaxInfos.GetHashCode();
public static bool operator ==(AggregateInfo? left, AggregateInfo? right)
=> Equals(left, right);
public static bool operator !=(AggregateInfo? left, AggregateInfo? right)
=> !Equals(left, right);
}