Class Field
A single field of a message type.
Inheritance
System.Object
Field
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 Field : IMessage<Field>, IMessage, IEquatable<Field>, IDeepCloneable<Field>
Constructors
Field()
Declaration
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
Declaration
public Field.Types.Cardinality Cardinality { get; set; }
Property Value
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
JsonName
Declaration
public string JsonName { get; set; }
Property Value
Type |
Description |
System.String |
|
Kind
Declaration
public Field.Types.Kind Kind { get; set; }
Property Value
Name
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
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
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
TypeUrl
The field type URL, without the scheme, for message or enumeration
types. Example: "type.googleapis.com/google.protobuf.Timestamp"
.
Declaration
public string TypeUrl { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
Returns
Implements
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()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(Field)
Declaration
public void MergeFrom(Field other)
Parameters
Type |
Name |
Description |
Field |
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