Repository navigation
Expand file tree
/
Copy pathKeyValueWatcher.cs
More file actions
57 lines (48 loc) · 1.64 KB
/
Copy pathKeyValueWatcher.cs
File metadata and controls
57 lines (48 loc) · 1.64 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using Microsoft.Extensions.Configuration.AzureAppConfiguration.Extensions;
using System;
using System.Collections.Generic;
namespace Microsoft.Extensions.Configuration.AzureAppConfiguration.Models
{
internal class KeyValueWatcher
{
/// <summary>
/// Key of the key-value to be watched.
/// </summary>
public string Key { get; set; }
/// <summary>
/// Label of the key-value to be watched.
/// </summary>
public string Label { get; set; }
/// <summary>
/// Tags of the key-value to be watched.
/// </summary>
public IEnumerable<string> Tags { get; set; }
/// <summary>
/// A flag to refresh all key-values.
/// </summary>
public bool RefreshAll { get; set; }
/// <summary>
/// The minimum time that must elapse before the key-value is refreshed.
/// </summary>
public TimeSpan RefreshInterval { get; set; }
/// <summary>
/// The next time when this key-value can be refreshed.
/// </summary>
public DateTimeOffset NextRefreshTime { get; set; }
public override bool Equals(object obj)
{
if (obj is KeyValueWatcher kvWatcher)
{
return Key == kvWatcher.Key && Label.NormalizeNull() == kvWatcher.Label.NormalizeNull();
}
return false;
}
public override int GetHashCode()
{
return Label != null ? Key.GetHashCode() ^ Label.GetHashCode() : Key.GetHashCode();
}
}
}