Class FieldDescriptorProto
Describes a field within a message.
Inheritance
System.Object
FieldDescriptorProto
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 FieldDescriptorProto : IMessage<FieldDescriptorProto>, IMessage, IEquatable<FieldDescriptorProto>, IDeepCloneable<FieldDescriptorProto>
Constructors
FieldDescriptorProto()
Declaration
public FieldDescriptorProto()
FieldDescriptorProto(FieldDescriptorProto)
Declaration
public FieldDescriptorProto(FieldDescriptorProto other)
Parameters
Fields
DefaultValueFieldNumber
Field number for the "default_value" field.
Declaration
public const int DefaultValueFieldNumber = 7
Field Value
Type |
Description |
System.Int32 |
|
ExtendeeFieldNumber
Field number for the "extendee" field.
Declaration
public const int ExtendeeFieldNumber = 2
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 |
|
LabelFieldNumber
Field number for the "label" field.
Declaration
public const int LabelFieldNumber = 4
Field Value
Type |
Description |
System.Int32 |
|
NameFieldNumber
Field number for the "name" field.
Declaration
public const int NameFieldNumber = 1
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 = 9
Field Value
Type |
Description |
System.Int32 |
|
OptionsFieldNumber
Field number for the "options" field.
Declaration
public const int OptionsFieldNumber = 8
Field Value
Type |
Description |
System.Int32 |
|
TypeFieldNumber
Field number for the "type" field.
Declaration
public const int TypeFieldNumber = 5
Field Value
Type |
Description |
System.Int32 |
|
TypeNameFieldNumber
Field number for the "type_name" field.
Declaration
public const int TypeNameFieldNumber = 6
Field Value
Type |
Description |
System.Int32 |
|
Properties
DefaultValue
For numeric types, contains the original text representation of the value.
For booleans, "true" or "false".
For strings, contains the default text contents (not escaped in any way).
For bytes, contains the C escaped value. All bytes >= 128 are escaped.
TODO(kenton): Base-64 encode?
Declaration
public string DefaultValue { get; set; }
Property Value
Type |
Description |
System.String |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Extendee
For extensions, this is the name of the type being extended. It is
resolved in the same manner as type_name.
Declaration
public string Extendee { get; set; }
Property Value
Type |
Description |
System.String |
|
HasDefaultValue
Gets whether the "default_value" field is set
Declaration
public bool HasDefaultValue { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasExtendee
Gets whether the "extendee" field is set
Declaration
public bool HasExtendee { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasJsonName
Gets whether the "json_name" field is set
Declaration
public bool HasJsonName { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasLabel
Gets whether the "label" field is set
Declaration
public bool HasLabel { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasName
Gets whether the "name" field is set
Declaration
public bool HasName { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasNumber
Gets whether the "number" field is set
Declaration
public bool HasNumber { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasOneofIndex
Gets whether the "oneof_index" field is set
Declaration
public bool HasOneofIndex { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasOptions
Gets whether the options field is set
Declaration
public bool HasOptions { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasType
Gets whether the "type" field is set
Declaration
public bool HasType { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasTypeName
Gets whether the "type_name" field is set
Declaration
public bool HasTypeName { get; }
Property Value
Type |
Description |
System.Boolean |
|
JsonName
JSON name of this field. The value is set by protocol compiler. If the
user has set a "json_name" option on this field, that option's value
will be used. Otherwise, it's deduced from the field's name by converting
it to camelCase.
Declaration
public string JsonName { get; set; }
Property Value
Type |
Description |
System.String |
|
Label
Declaration
public FieldDescriptorProto.Types.Label Label { 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
If set, gives the index of a oneof in the containing type's oneof_decl
list. This field is a member of that oneof.
Declaration
public int OneofIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Options
Declaration
public FieldOptions Options { get; set; }
Property Value
Parser
Declaration
public static MessageParser<FieldDescriptorProto> Parser { get; }
Property Value
Type
If type_name is set, this need not be set. If both this and type_name
are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
Declaration
public FieldDescriptorProto.Types.Type Type { get; set; }
Property Value
TypeName
For message and enum types, this is the name of the type. If the name
starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
rules are used to find the type (i.e. first the nested types within this
message are searched, then within the parent, on up to the root
namespace).
Declaration
public string TypeName { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
ClearDefaultValue()
Clears the value of the "default_value" field
Declaration
public void ClearDefaultValue()
ClearExtendee()
Clears the value of the "extendee" field
Declaration
public void ClearExtendee()
ClearJsonName()
Clears the value of the "json_name" field
Declaration
public void ClearJsonName()
ClearLabel()
Clears the value of the "label" field
Declaration
ClearName()
Clears the value of the "name" field
Declaration
ClearNumber()
Clears the value of the "number" field
Declaration
public void ClearNumber()
ClearOneofIndex()
Clears the value of the "oneof_index" field
Declaration
public void ClearOneofIndex()
ClearOptions()
Clears the value of the options field
Declaration
public void ClearOptions()
ClearType()
Clears the value of the "type" field
Declaration
ClearTypeName()
Clears the value of the "type_name" field
Declaration
public void ClearTypeName()
Clone()
Declaration
public FieldDescriptorProto Clone()
Returns
Implements
Equals(FieldDescriptorProto)
Declaration
public bool Equals(FieldDescriptorProto other)
Parameters
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(FieldDescriptorProto)
Declaration
public void MergeFrom(FieldDescriptorProto other)
Parameters
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