public interface IFieldAccessor
Allows fields to be reflectively accessed.
Namespace
Google.Protobuf.ReflectionAssembly
Google.Protobuf.dll
Properties
Descriptor
FieldDescriptor Descriptor { get; }
Returns the descriptor associated with this field.
Property Value | |
---|---|
Type | Description |
FieldDescriptor |
Methods
Clear(IMessage)
void Clear(IMessage message)
Clears the field in the specified message. (For repeated fields, this clears the list.)
Parameter | |
---|---|
Name | Description |
message | IMessage |
GetValue(IMessage)
object GetValue(IMessage message)
Fetches the field value. For repeated values, this will be an implementation. For map values, this will be an implementation.
Parameter | |
---|---|
Name | Description |
message | IMessage |
Returns | |
---|---|
Type | Description |
Object |
HasValue(IMessage)
bool HasValue(IMessage message)
Indicates whether the field in the specified message is set. For proto3 fields that aren't explicitly optional, this throws an
Parameter | |
---|---|
Name | Description |
message | IMessage |
Returns | |
---|---|
Type | Description |
Boolean |
SetValue(IMessage, Object)
void SetValue(IMessage message, object value)
Mutator for single "simple" fields only.
Parameters | |
---|---|
Name | Description |
message | IMessage |
value | Object |
Repeated fields are mutated by fetching the value and manipulating it as a list. Map fields are mutated by fetching the value and manipulating it as a dictionary.