Show / Hide Table of Contents

Class Option

A protocol buffer option, which can be attached to a message, field, enumeration, etc.

Inheritance
System.Object
Option
Implements
IMessage<Option>
IMessage
System.IEquatable<Option>
IDeepCloneable<Option>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf.WellKnownTypes
Assembly: Google.Protobuf.dll
Syntax
public sealed class Option : IMessage<Option>, IMessage, IEquatable<Option>, IDeepCloneable<Option>

Constructors

Option()

Declaration
public Option()

Option(Option)

Declaration
public Option(Option other)
Parameters
Type Name Description
Option other

Fields

NameFieldNumber

Field number for the "name" field.

Declaration
public const int NameFieldNumber = 1
Field Value
Type Description
System.Int32

ValueFieldNumber

Field number for the "value" field.

Declaration
public const int ValueFieldNumber = 2
Field Value
Type Description
System.Int32

Properties

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Name

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;.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Parser

Declaration
public static MessageParser<Option> Parser { get; }
Property Value
Type Description
MessageParser<Option>

Value

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.

Declaration
public Any Value { get; set; }
Property Value
Type Description
Any

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public Option Clone()
Returns
Type Description
Option
Implements
IDeepCloneable<T>.Clone()

Equals(Option)

Declaration
public bool Equals(Option other)
Parameters
Type Name Description
Option other
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)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

MergeFrom(Option)

Declaration
public void MergeFrom(Option other)
Parameters
Type Name Description
Option other
Implements
IMessage<T>.MergeFrom(T)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor

Extension Methods

MessageExtensions.MergeFrom(IMessage, Byte[])
MessageExtensions.MergeFrom(IMessage, Byte[], Int32, Int32)
MessageExtensions.MergeFrom(IMessage, ByteString)
MessageExtensions.MergeFrom(IMessage, Stream)
MessageExtensions.MergeDelimitedFrom(IMessage, Stream)
MessageExtensions.ToByteArray(IMessage)
MessageExtensions.WriteTo(IMessage, Stream)
MessageExtensions.WriteDelimitedTo(IMessage, Stream)
MessageExtensions.ToByteString(IMessage)
MessageExtensions.IsInitialized(IMessage)
Back to top