-
Notifications
You must be signed in to change notification settings - Fork 533
Expand file tree
/
Copy pathNameValueResponseHeaders.cs
More file actions
74 lines (61 loc) · 2.21 KB
/
NameValueResponseHeaders.cs
File metadata and controls
74 lines (61 loc) · 2.21 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace Microsoft.Azure.Cosmos
{
using System;
using System.Collections.Generic;
using Microsoft.Azure.Documents.Collections;
/// <summary>
/// Header implementation used for Responses
/// </summary>
internal sealed class NameValueResponseHeaders : CosmosMessageHeadersInternal
{
public override INameValueCollection INameValueCollection { get; }
public NameValueResponseHeaders(INameValueCollection nameValueCollection)
{
this.INameValueCollection = nameValueCollection ?? throw new ArgumentNullException(nameof(nameValueCollection));
}
public override void Add(string headerName, string value)
{
this.INameValueCollection.Add(headerName, value);
}
public override void Add(string headerName, IEnumerable<string> values)
{
this.INameValueCollection.Add(headerName, values);
}
public override void Set(string headerName, string value)
{
this.INameValueCollection.Set(headerName, value);
}
public override string Get(string headerName)
{
return this.INameValueCollection.Get(headerName);
}
public override bool TryGetValue(string headerName, out string value)
{
value = this.INameValueCollection.Get(headerName);
return value != null;
}
public override void Remove(string headerName)
{
this.INameValueCollection.Remove(headerName);
}
public override string[] AllKeys()
{
return this.INameValueCollection.AllKeys();
}
public override IEnumerator<string> GetEnumerator()
{
return this.INameValueCollection.Keys().GetEnumerator();
}
public override int Count()
{
return this.INameValueCollection.Count();
}
public override string[] GetValues(string key)
{
return this.INameValueCollection.GetValues(key);
}
}
}