Class MessageDescriptor.FieldCollection (3.27.1)
Stay organized with collections
Save and categorize content based on your preferences.
public sealed class MessageDescriptor.FieldCollectionA collection to simplify retrieving the field accessor for a particular field.
Inherited Members
Namespace
Google.Protobuf.ReflectionAssembly
Google.Protobuf.dll
Properties
this[int]
publicFieldDescriptorthis[intnumber]{get;}Retrieves the descriptor for the field with the given number.
| Parameter | |
|---|---|
| Name | Description |
number |
int Number of the field to retrieve the descriptor for |
| Property Value | |
|---|---|
| Type | Description |
FieldDescriptor |
The accessor for the given field |
| Exceptions | |
|---|---|
| Type | Description |
KeyNotFoundException |
The message descriptor does not contain a field with the given number |
this[string]
publicFieldDescriptorthis[stringname]{get;}Retrieves the descriptor for the field with the given name.
| Parameter | |
|---|---|
| Name | Description |
name |
string Name of the field to retrieve the descriptor for |
| Property Value | |
|---|---|
| Type | Description |
FieldDescriptor |
The descriptor for the given field |
| Exceptions | |
|---|---|
| Type | Description |
KeyNotFoundException |
The message descriptor does not contain a field with the given name |
Methods
InDeclarationOrder()
public IList<FieldDescriptor> InDeclarationOrder()| Returns | |
|---|---|
| Type | Description |
IList FieldDescriptor |
Returns the fields in the message as an immutable list, in the order in which they are declared in the source .proto file. |
InFieldNumberOrder()
public IList<FieldDescriptor> InFieldNumberOrder()| Returns | |
|---|---|
| Type | Description |
IList FieldDescriptor |
Returns the fields in the message as an immutable list, in ascending field number order. Field numbers need not be contiguous, so there is no direct mapping from the index in the list to the field number; to retrieve a field by field number, it is better to use the MessageDescriptor.FieldCollection indexer. |