-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStringColumn.cs
More file actions
39 lines (31 loc) · 1.09 KB
/
StringColumn.cs
File metadata and controls
39 lines (31 loc) · 1.09 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
using System;
namespace Queries.Core.Parts.Columns;
/// <summary>
/// A column that can hold a <see langword="string"/> value.
/// </summary>
public class StringColumn : Literal, IEquatable<StringColumn>
{
/// <summary>
/// Builds a new <see cref="StringColumn"/> instance.
/// </summary>
/// <param name="value"></param>
public StringColumn(string value = "")
: base(value)
{}
///<inheritdoc/>
public override IColumn Clone() => new StringColumn((string)Value).As(Alias);
///<inheritdoc/>
public bool Equals(StringColumn other) => (Value, Alias).Equals((other?.Value, other?.Alias));
///<inheritdoc/>
public override bool Equals(object obj) => Equals(obj as StringColumn);
///<inheritdoc/>
#if !NETSTANDARD2_1
public override int GetHashCode() => (Value, Alias).GetHashCode();
#else
public override int GetHashCode() => HashCode.Combine(Value, Alias);
#endif
///<inheritdoc/>
public override string ToString() => this.Jsonify();
///<inheritdoc/>
public static implicit operator StringColumn(string input) => new(input);
}