Google.Protobuf.Reflection.MessageDescriptor.FieldCollection

A collection to simplify retrieving the field accessor for a particular field.

Summary

Properties

this[int number]
Retrieves the descriptor for the field with the given number.
this[string name]
Retrieves the descriptor for the field with the given name.

Public functions

InDeclarationOrder()
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()
IList< FieldDescriptor >
Returns the fields in the message as an immutable list, in ascending field number order.

Properties

this[int number]

FieldDescriptor this[int number]

Retrieves the descriptor for the field with the given number.

Details
Parameters
number
Number of the field to retrieve the descriptor for
Exceptions
KeyNotFoundException
The message descriptor does not contain a field with the given number
Returns
The accessor for the given field

this[string name]

FieldDescriptor this[string name]

Retrieves the descriptor for the field with the given name.

Details
Parameters
name
Name of the field to retrieve the descriptor for
Exceptions
KeyNotFoundException
The message descriptor does not contain a field with the given name
Returns
The descriptor for the given field

Public functions

InDeclarationOrder

IList< FieldDescriptor > InDeclarationOrder()

Returns the fields in the message as an immutable list, in the order in which they are declared in the source .proto file.

InFieldNumberOrder

IList< FieldDescriptor > InFieldNumberOrder()

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 FieldCollection indexer.