Show / Hide Table of Contents

Class Field

A single field of a message type.

Inheritance
System.Object
Field
Implements
IMessage<Field>
IMessage
System.IEquatable<Field>
IDeepCloneable<Field>
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 Field : IMessage<Field>, IMessage, IEquatable<Field>, IDeepCloneable<Field>

Constructors

Field()

Declaration
public Field()

Field(Field)

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

Fields

CardinalityFieldNumber

Field number for the "cardinality" field.

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

DefaultValueFieldNumber

Field number for the "default_value" field.

Declaration
public const int DefaultValueFieldNumber = 11
Field Value
Type Description
System.Int32

JsonNameFieldNumber

Field number for the "json_name" field.

Declaration
public const int JsonNameFieldNumber = 10
Field Value
Type Description
System.Int32

KindFieldNumber

Field number for the "kind" field.

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

NameFieldNumber

Field number for the "name" field.

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

NumberFieldNumber

Field number for the "number" field.

Declaration
public const int NumberFieldNumber = 3
Field Value
Type Description
System.Int32

OneofIndexFieldNumber

Field number for the "oneof_index" field.

Declaration
public const int OneofIndexFieldNumber = 7
Field Value
Type Description
System.Int32

OptionsFieldNumber

Field number for the "options" field.

Declaration
public const int OptionsFieldNumber = 9
Field Value
Type Description
System.Int32

PackedFieldNumber

Field number for the "packed" field.

Declaration
public const int PackedFieldNumber = 8
Field Value
Type Description
System.Int32

TypeUrlFieldNumber

Field number for the "type_url" field.

Declaration
public const int TypeUrlFieldNumber = 6
Field Value
Type Description
System.Int32

Properties

Cardinality

The field cardinality.

Declaration
public Field.Types.Cardinality Cardinality { get; set; }
Property Value
Type Description
Field.Types.Cardinality

DefaultValue

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

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

Descriptor

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

JsonName

The field JSON name.

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

Kind

The field type.

Declaration
public Field.Types.Kind Kind { get; set; }
Property Value
Type Description
Field.Types.Kind

Name

The field name.

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

Number

The field number.

Declaration
public int Number { get; set; }
Property Value
Type Description
System.Int32

OneofIndex

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.

Declaration
public int OneofIndex { get; set; }
Property Value
Type Description
System.Int32

Options

The protocol buffer options.

Declaration
public RepeatedField<Option> Options { get; }
Property Value
Type Description
RepeatedField<Option>

Packed

Whether to use alternative packed wire representation.

Declaration
public bool Packed { get; set; }
Property Value
Type Description
System.Boolean

Parser

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

TypeUrl

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

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

Methods

CalculateSize()

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

Clone()

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

Equals(Field)

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

Declaration
public void MergeFrom(Field other)
Parameters
Type Name Description
Field 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