Class Field (3.15.8)

public sealed class Field : object, IMessage<Field>, IEquatable<Field>, IDeepCloneable<Field>, IBufferMessage, IMessage

A single field of a message type.

Inheritance

Object > Field

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Field()

public Field()

Field(Field)

public Field(Field other)
Parameter
NameDescription
otherField

Fields

CardinalityFieldNumber

public const int CardinalityFieldNumber = null

Field number for the "cardinality" field.

Field Value
TypeDescription
Int32

DefaultValueFieldNumber

public const int DefaultValueFieldNumber = null

Field number for the "default_value" field.

Field Value
TypeDescription
Int32

JsonNameFieldNumber

public const int JsonNameFieldNumber = null

Field number for the "json_name" field.

Field Value
TypeDescription
Int32

KindFieldNumber

public const int KindFieldNumber = null

Field number for the "kind" field.

Field Value
TypeDescription
Int32

NameFieldNumber

public const int NameFieldNumber = null

Field number for the "name" field.

Field Value
TypeDescription
Int32

NumberFieldNumber

public const int NumberFieldNumber = null

Field number for the "number" field.

Field Value
TypeDescription
Int32

OneofIndexFieldNumber

public const int OneofIndexFieldNumber = null

Field number for the "oneof_index" field.

Field Value
TypeDescription
Int32

OptionsFieldNumber

public const int OptionsFieldNumber = null

Field number for the "options" field.

Field Value
TypeDescription
Int32

PackedFieldNumber

public const int PackedFieldNumber = null

Field number for the "packed" field.

Field Value
TypeDescription
Int32

TypeUrlFieldNumber

public const int TypeUrlFieldNumber = null

Field number for the "type_url" field.

Field Value
TypeDescription
Int32

Properties

Cardinality

public Field.Types.Cardinality Cardinality { get; set; }

The field cardinality.

Property Value
TypeDescription
Field.Types.Cardinality

DefaultValue

public string DefaultValue { get; set; }

The string value of the default value of this field. Proto2 syntax only.

Property Value
TypeDescription
String

Descriptor

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

JsonName

public string JsonName { get; set; }

The field JSON name.

Property Value
TypeDescription
String

Kind

public Field.Types.Kind Kind { get; set; }

The field type.

Property Value
TypeDescription
Field.Types.Kind

Name

public string Name { get; set; }

The field name.

Property Value
TypeDescription
String

Number

public int Number { get; set; }

The field number.

Property Value
TypeDescription
Int32

OneofIndex

public int OneofIndex { get; set; }

The index of the field type in Type.oneofs, for message or enumeration types. The first type has index 1; zero means the type is not in the list.

Property Value
TypeDescription
Int32

Options

public RepeatedField<Option> Options { get; }

The protocol buffer options.

Property Value
TypeDescription
RepeatedField<Option>

Packed

public bool Packed { get; set; }

Whether to use alternative packed wire representation.

Property Value
TypeDescription
Boolean

Parser

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

TypeUrl

public string TypeUrl { get; set; }

The field type URL, without the scheme, for message or enumeration types. Example: &quot;type.googleapis.com/google.protobuf.Timestamp&quot;.

Property Value
TypeDescription
String

Methods

CalculateSize()

public int CalculateSize()
Returns
TypeDescription
Int32

Clone()

public Field Clone()
Returns
TypeDescription
Field

Equals(Field)

public bool Equals(Field other)
Parameter
NameDescription
otherField
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(Field)

public void MergeFrom(Field other)
Parameter
NameDescription
otherField

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