Class MessageOptions
Inheritance
System.Object
MessageOptions
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Protobuf.dll
Syntax
public sealed class MessageOptions : IExtendableMessage<MessageOptions>, IMessage<MessageOptions>, IMessage, IEquatable<MessageOptions>, IDeepCloneable<MessageOptions>
Constructors
MessageOptions()
Declaration
MessageOptions(MessageOptions)
Declaration
public MessageOptions(MessageOptions other)
Parameters
Fields
DeprecatedFieldNumber
Field number for the "deprecated" field.
Declaration
public const int DeprecatedFieldNumber = 3
Field Value
Type |
Description |
System.Int32 |
|
MapEntryFieldNumber
Field number for the "map_entry" field.
Declaration
public const int MapEntryFieldNumber = 7
Field Value
Type |
Description |
System.Int32 |
|
Field number for the "message_set_wire_format" field.
Declaration
public const int MessageSetWireFormatFieldNumber = 1
Field Value
Type |
Description |
System.Int32 |
|
NoStandardDescriptorAccessorFieldNumber
Field number for the "no_standard_descriptor_accessor" field.
Declaration
public const int NoStandardDescriptorAccessorFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
UninterpretedOptionFieldNumber
Field number for the "uninterpreted_option" field.
Declaration
public const int UninterpretedOptionFieldNumber = 999
Field Value
Type |
Description |
System.Int32 |
|
Properties
Deprecated
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.
Declaration
public bool Deprecated { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
HasDeprecated
Gets whether the "deprecated" field is set
Declaration
public bool HasDeprecated { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasMapEntry
Gets whether the "map_entry" field is set
Declaration
public bool HasMapEntry { get; }
Property Value
Type |
Description |
System.Boolean |
|
Gets whether the "message_set_wire_format" field is set
Declaration
public bool HasMessageSetWireFormat { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasNoStandardDescriptorAccessor
Gets whether the "no_standard_descriptor_accessor" field is set
Declaration
public bool HasNoStandardDescriptorAccessor { get; }
Property Value
Type |
Description |
System.Boolean |
|
MapEntry
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.
Declaration
public bool MapEntry { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
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.
Declaration
public bool MessageSetWireFormat { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
NoStandardDescriptorAccessor
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".
Declaration
public bool NoStandardDescriptorAccessor { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Parser
Declaration
public static MessageParser<MessageOptions> Parser { get; }
Property Value
UninterpretedOption
The parser stores options it doesn't recognize here. See above.
Declaration
public RepeatedField<UninterpretedOption> UninterpretedOption { get; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
ClearDeprecated()
Clears the value of the "deprecated" field
Declaration
public void ClearDeprecated()
ClearExtension<TValue>(Extension<MessageOptions, TValue>)
Declaration
public void ClearExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameters
Type Parameters
Implements
ClearExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
Declaration
public void ClearExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameters
Type Parameters
Implements
ClearMapEntry()
Clears the value of the "map_entry" field
Declaration
public void ClearMapEntry()
Clears the value of the "message_set_wire_format" field
Declaration
public void ClearMessageSetWireFormat()
ClearNoStandardDescriptorAccessor()
Clears the value of the "no_standard_descriptor_accessor" field
Declaration
public void ClearNoStandardDescriptorAccessor()
Clone()
Declaration
public MessageOptions Clone()
Returns
Implements
Equals(MessageOptions)
Declaration
public bool Equals(MessageOptions other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetExtension<TValue>(Extension<MessageOptions, TValue>)
Declaration
public TValue GetExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameters
Returns
Type Parameters
Implements
GetExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
Declaration
public RepeatedField<TValue> GetExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameters
Returns
Type Parameters
Implements
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
GetOrInitializeExtension<TValue>(RepeatedExtension<MessageOptions, TValue>)
Declaration
public RepeatedField<TValue> GetOrInitializeExtension<TValue>(RepeatedExtension<MessageOptions, TValue> extension)
Parameters
Returns
Type Parameters
Implements
HasExtension<TValue>(Extension<MessageOptions, TValue>)
Declaration
public bool HasExtension<TValue>(Extension<MessageOptions, TValue> extension)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Implements
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(MessageOptions)
Declaration
public void MergeFrom(MessageOptions other)
Parameters
Implements
SetExtension<TValue>(Extension<MessageOptions, TValue>, TValue)
Declaration
public void SetExtension<TValue>(Extension<MessageOptions, TValue> extension, TValue value)
Parameters
Type Parameters
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements
Extension Methods