Class Option (3.15.8)

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.

Inheritance

Object > Option

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Option()

public Option()

Option(Option)

public Option(Option other)
Parameter
NameDescription
otherOption

Fields

NameFieldNumber

public const int NameFieldNumber = null

Field number for the "name" field.

Field Value
TypeDescription
Int32

ValueFieldNumber

public const int ValueFieldNumber = null

Field number for the "value" field.

Field Value
TypeDescription
Int32

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

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, &quot;map_entry&quot;. For custom options, it should be the fully-qualified name. For example, &quot;google.api.http&quot;.

Property Value
TypeDescription
String

Parser

public static MessageParser<Option> Parser { get; }
Property Value
TypeDescription
MessageParser<Option>

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
TypeDescription
Any

Methods

CalculateSize()

public int CalculateSize()
Returns
TypeDescription
Int32

Clone()

public Option Clone()
Returns
TypeDescription
Option

Equals(Option)

public bool Equals(Option other)
Parameter
NameDescription
otherOption
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
Boolean

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream

MergeFrom(Option)

public void MergeFrom(Option other)
Parameter
NameDescription
otherOption

ToString()

public override string ToString()
Returns
TypeDescription
String

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream

Explicit Interface Implementations

IBufferMessage.InternalMergeFrom(ref ParseContext)

void IBufferMessage.InternalMergeFrom(ref ParseContext input)
Parameter
NameDescription
inputParseContext

IBufferMessage.InternalWriteTo(ref WriteContext)

void IBufferMessage.InternalWriteTo(ref WriteContext output)
Parameter
NameDescription
outputWriteContext

IMessage.Descriptor

MessageDescriptor IMessage.Descriptor { get; }
Returns
TypeDescription
MessageDescriptor