Class Option
A protocol buffer option, which can be attached to a message, field,
enumeration, etc.
Inheritance
System.Object
Option
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 Option : IMessage<Option>, IMessage, IEquatable<Option>, IDeepCloneable<Option>
Constructors
Option()
Declaration
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
Name
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"
.
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
Parser
Declaration
public static MessageParser<Option> Parser { get; }
Property Value
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
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
Returns
Implements
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()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(Option)
Declaration
public void MergeFrom(Option other)
Parameters
Type |
Name |
Description |
Option |
other |
|
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