Skip to content

Commit

Permalink
Merge pull request grpc#6827 from jtattermusch/csharp_metadata_entry_…
Browse files Browse the repository at this point in the history
…is_class

Make Metadata.Entry a class
  • Loading branch information
jtattermusch committed Jun 8, 2016
2 parents 026dfe6 + c524ec0 commit 7eaae43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/csharp/Grpc.Core/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public int IndexOf(Metadata.Entry item)

public void Insert(int index, Metadata.Entry item)
{
GrpcPreconditions.CheckNotNull(item);
CheckWriteable();
entries.Insert(index, item);
}
Expand All @@ -114,13 +115,15 @@ public Metadata.Entry this[int index]

set
{
GrpcPreconditions.CheckNotNull(value);
CheckWriteable();
entries[index] = value;
}
}

public void Add(Metadata.Entry item)
{
GrpcPreconditions.CheckNotNull(item);
CheckWriteable();
entries.Add(item);
}
Expand Down Expand Up @@ -187,7 +190,7 @@ private void CheckWriteable()
/// <summary>
/// Metadata entry
/// </summary>
public struct Entry
public class Entry
{
private static readonly Encoding Encoding = Encoding.ASCII;
private static readonly Regex ValidKeyRegex = new Regex("^[a-z0-9_-]+$");
Expand Down

0 comments on commit 7eaae43

Please sign in to comment.