public sealed class MessageOptions : object, IExtendableMessage<MessageOptions>, IMessage<MessageOptions>, IEquatable<MessageOptions>, IDeepCloneable<MessageOptions>, IBufferMessage, IMessage
Inheritance
Object >
MessageOptions
Namespace
Google.Protobuf.Reflection
Assembly
Google.Protobuf.dll
Constructors
MessageOptions()
MessageOptions(MessageOptions)
public MessageOptions(MessageOptions other)
Parameter
Fields
DeprecatedFieldNumber
public const int DeprecatedFieldNumber = null
Field number for the "deprecated" field.
Field Value
MapEntryFieldNumber
public const int MapEntryFieldNumber = null
Field number for the "map_entry" field.
Field Value
public const int MessageSetWireFormatFieldNumber = null
Field number for the "message_set_wire_format" field.
Field Value
NoStandardDescriptorAccessorFieldNumber
public const int NoStandardDescriptorAccessorFieldNumber = null
Field number for the "no_standard_descriptor_accessor" field.
Field Value
UninterpretedOptionFieldNumber
public const int UninterpretedOptionFieldNumber = null
Field number for the "uninterpreted_option" field.
Field Value
Properties
Deprecated
public bool Deprecated { get; set; }
Is this message deprecated?
Depending on the target platform, this can emit Deprecated annotations
for the message, or it will be completely ignored; in the very least,
this is a formalization for deprecating messages.
Property Value
Descriptor
public static MessageDescriptor Descriptor { get; }
Property Value
HasDeprecated
public bool HasDeprecated { get; }
Gets whether the "deprecated" field is set
Property Value
HasMapEntry
public bool HasMapEntry { get; }
Gets whether the "map_entry" field is set
Property Value
public bool HasMessageSetWireFormat { get; }
Gets whether the "message_set_wire_format" field is set
Property Value
HasNoStandardDescriptorAccessor
public bool HasNoStandardDescriptorAccessor { get; }
Gets whether the "no_standard_descriptor_accessor" field is set
Property Value
MapEntry
public bool MapEntry { get; set; }
Whether the message is an automatically generated map entry type for the
maps field.
For maps fields:
map<KeyType, ValueType> map_field = 1;
The parsed descriptor looks like:
message MapFieldEntry {
option map_entry = true;
optional KeyType key = 1;
optional ValueType value = 2;
}
repeated MapFieldEntry map_field = 1;
Implementations may choose not to generate the map_entry=true message, but
use a native map in the target language to hold the keys and values.
The reflection APIs in such implementations still need to work as
if the field is a repeated message field.
NOTE: Do not set the option in .proto files. Always use the maps syntax
instead. The option should only be implicitly set by the proto compiler
parser.
Property Value
public bool MessageSetWireFormat { get; set; }
Set true to use the old proto1 MessageSet wire format for extensions.
This is provided for backwards-compatibility with the MessageSet wire
format. You should not use this for any other reason: It's less
efficient, has fewer features, and is more complicated.
The message must be defined exactly as follows:
message Foo {
option message_set_wire_format = true;
extensions 4 to max;
}
Note that the message cannot have any defined fields; MessageSets only
have extensions.
All extensions of your type must be singular messages; e.g. they cannot
be int32s, enums, or repeated messages.
Because this is an option, the above two restrictions are not enforced by
the protocol compiler.
Property Value
NoStandardDescriptorAccessor
public bool NoStandardDescriptorAccessor { get; set; }
Disables the generation of the standard "descriptor()" accessor, which can
conflict with a field of the same name. This is meant to make migration
from proto1 easier; new code should avoid fields named "descriptor".
Property Value
Parser
public static MessageParser<MessageOptions> Parser { get; }
Property Value
UninterpretedOption
public RepeatedField<UninterpretedOption> UninterpretedOption { get; }
The parser stores options it doesn't recognize here. See above.
Property Value
Methods
CalculateSize()
public int CalculateSize()
Returns
ClearDeprecated()
public void ClearDeprecated()
Clears the value of the "deprecated" field
ClearExtension<TValue>(Extension<MessageOptions, TValue>)
public void ClearExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameter
Type Parameter
ClearExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
public void ClearExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameter
Type Parameter
ClearMapEntry()
public void ClearMapEntry()
Clears the value of the "map_entry" field
public void ClearMessageSetWireFormat()
Clears the value of the "message_set_wire_format" field
ClearNoStandardDescriptorAccessor()
public void ClearNoStandardDescriptorAccessor()
Clears the value of the "no_standard_descriptor_accessor" field
Clone()
public MessageOptions Clone()
Returns
Equals(MessageOptions)
public bool Equals(MessageOptions other)
Parameter
Returns
Equals(Object)
public override bool Equals(object other)
Parameter
Returns
GetExtension<TValue>(Extension<MessageOptions, TValue>)
public TValue GetExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameter
Returns
Type Parameter
GetExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
public RepeatedField<TValue> GetExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameter
Returns
Type Parameter
GetHashCode()
public override int GetHashCode()
Returns
GetOrInitializeExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
public RepeatedField<TValue> GetOrInitializeExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameter
Returns
Type Parameter
HasExtension<TValue>(Extension<MessageOptions, TValue>)
public bool HasExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameter
Returns
Type Parameter
public void MergeFrom(CodedInputStream input)
Parameter
MergeFrom(MessageOptions)
public void MergeFrom(MessageOptions other)
Parameter
SetExtension<TValue>(Extension<MessageOptions, TValue>, TValue)
public void SetExtension<TValue>(Extension<MessageOptions, TValue> extension, TValue value)
Parameters
Type Parameter
ToString()
public override string ToString()
Returns
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)
Parameter
Explicit Interface Implementations
IBufferMessage.InternalMergeFrom(ref ParseContext)
void IBufferMessage.InternalMergeFrom(ref ParseContext input)
Parameter
IBufferMessage.InternalWriteTo(ref WriteContext)
void IBufferMessage.InternalWriteTo(ref WriteContext output)
Parameter
IMessage.Descriptor
MessageDescriptor IMessage.Descriptor { get; }
Returns