forked from TNG/ArchUnitNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringIdentifier.cs
More file actions
40 lines (35 loc) · 1.02 KB
/
StringIdentifier.cs
File metadata and controls
40 lines (35 loc) · 1.02 KB
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
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
// Copyright 2020 Pavel Fischer <rubbiroid@gmail.com>
//
// SPDX-License-Identifier: Apache-2.0
//
namespace ArchUnitNET.Domain
{
public class StringIdentifier
{
public readonly string Identifier;
public StringIdentifier(string identifier)
{
Identifier = identifier;
}
public override string ToString()
{
return Identifier;
}
public override bool Equals(object obj)
{
return obj != null && obj.GetType() == GetType() &&
Identifier == ((StringIdentifier)obj).Identifier;
}
public override int GetHashCode()
{
unchecked
{
var hashCode = 397 ^ GetType().GetHashCode();
hashCode = (hashCode * 397) ^ Identifier.GetHashCode();
return hashCode;
}
}
}
}