public sealed class Option : object, IMessage<Option>, IEquatable<Option>, IDeepCloneable<Option>, IBufferMessage, IMessage
A protocol buffer option, which can be attached to a message, field,
enumeration, etc.
Namespace
Google.Protobuf.WellKnownTypes
Assembly
Google.Protobuf.dll
Constructors
Option()
Option(Option)
public Option(Option other)
Parameter
Type | Name | Description |
---|
Option | other | |
Fields
NameFieldNumber
public const int NameFieldNumber = null
Field number for the "name" field.
Field Value
ValueFieldNumber
public const int ValueFieldNumber = null
Field number for the "value" field.
Field Value
Properties
Descriptor
public static MessageDescriptor Descriptor { get; }
Property Value
Name
public string Name { get; set; }
The option's name. For protobuf built-in options (options defined in
descriptor.proto), this is the short name. For example, "map_entry"
.
For custom options, it should be the fully-qualified name. For example,
"google.api.http"
.
Property Value
Parser
public static MessageParser<Option> Parser { get; }
Property Value
Value
public Any Value { get; set; }
The option's value packed in an Any message. If the value is a primitive,
the corresponding wrapper type defined in google/protobuf/wrappers.proto
should be used. If the value is an enum, it should be stored as an int32
value using the google.protobuf.Int32Value type.
Property Value
Methods
CalculateSize()
public int CalculateSize()
Returns
Clone()
Returns
Equals(Option)
public bool Equals(Option other)
Parameter
Type | Name | Description |
---|
Option | other | |
Returns
Equals(Object)
public override bool Equals(object other)
Parameter
Type | Name | Description |
---|
Object | other | |
Returns
GetHashCode()
public override int GetHashCode()
Returns
public void MergeFrom(CodedInputStream input)
Parameter
MergeFrom(Option)
public void MergeFrom(Option other)
Parameter
Type | Name | Description |
---|
Option | other | |
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
Implements
IEquatable<>