Class Metadata.Entry
Metadata entry
Inheritance
Inherited Members
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public class Entry
Constructors
Entry(String, Byte[])
Initializes a new instance of the Metadata.
Declaration
public Entry(string key, byte[] valueBytes)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots. |
System. |
valueBytes | Value bytes. |
Entry(String, String)
Initializes a new instance of the Metadata.
Declaration
public Entry(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots. |
System. |
value | Value string. Only ASCII characters are allowed. |
Properties
IsBinary
Returns true
if this entry is a binary-value entry.
Declaration
public bool IsBinary { get; }
Property Value
Type | Description |
---|---|
System. |
Key
Gets the metadata entry key.
Declaration
public string Key { get; }
Property Value
Type | Description |
---|---|
System. |
Value
Gets the string value of this metadata entry. If the metadata entry is binary then an exception is thrown.
Declaration
public string Value { get; }
Property Value
Type | Description |
---|---|
System. |
ValueBytes
Gets the binary value of this metadata entry. If the metadata entry is not binary the string value will be returned as ASCII encoded bytes.
Declaration
public byte[] ValueBytes { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |