diff options
author | Robbie Shade <rjshade@google.com> | 2015-08-13 16:12:26 -0400 |
---|---|---|
committer | Robbie Shade <rjshade@google.com> | 2015-08-13 16:12:26 -0400 |
commit | 37ad56b469836b7d4b3e9753913e37aae3ac46c7 (patch) | |
tree | d8d3cdf9f50f66ac567523872096f2f555a13b43 /src/csharp/Grpc.Core/Metadata.cs | |
parent | 98981efe0d29626645abc2ff495737a078bab021 (diff) | |
parent | 118f65dc8c5df39872aff5f6bf269b16ce82c259 (diff) |
Merge remote-tracking branch 'upstream/master' into add_udp_server_2
Diffstat (limited to 'src/csharp/Grpc.Core/Metadata.cs')
-rw-r--r-- | src/csharp/Grpc.Core/Metadata.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index 6fd0a7109d..9db2abf46e 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -114,6 +114,16 @@ namespace Grpc.Core entries.Add(item); } + public void Add(string key, string value) + { + Add(new Entry(key, value)); + } + + public void Add(string key, byte[] valueBytes) + { + Add(new Entry(key, valueBytes)); + } + public void Clear() { CheckWriteable(); @@ -176,15 +186,15 @@ namespace Grpc.Core public Entry(string key, byte[] valueBytes) { - this.key = Preconditions.CheckNotNull(key); + this.key = Preconditions.CheckNotNull(key, "key"); this.value = null; - this.valueBytes = Preconditions.CheckNotNull(valueBytes); + this.valueBytes = Preconditions.CheckNotNull(valueBytes, "valueBytes"); } public Entry(string key, string value) { - this.key = Preconditions.CheckNotNull(key); - this.value = Preconditions.CheckNotNull(value); + this.key = Preconditions.CheckNotNull(key, "key"); + this.value = Preconditions.CheckNotNull(value, "value"); this.valueBytes = null; } |