Skip to main content

Class: FieldDescriptorProto

google.protobuf.FieldDescriptorProto

Represents a FieldDescriptorProto.

Implements#

Constructors#

constructor#

new FieldDescriptorProto(properties?)

Constructs a new FieldDescriptorProto.

Parameters#

NameType
properties?IFieldDescriptorProto

Properties#

defaultValue#

defaultValue: string

FieldDescriptorProto defaultValue.

Implementation of#

IFieldDescriptorProto.defaultValue


extendee#

extendee: string

FieldDescriptorProto extendee.

Implementation of#

IFieldDescriptorProto.extendee


jsonName#

jsonName: string

FieldDescriptorProto jsonName.

Implementation of#

IFieldDescriptorProto.jsonName


label#

label: Label

FieldDescriptorProto label.

Implementation of#

IFieldDescriptorProto.label


name#

name: string

FieldDescriptorProto name.

Implementation of#

IFieldDescriptorProto.name


number#

number: number

FieldDescriptorProto number.

Implementation of#

IFieldDescriptorProto.number


oneofIndex#

oneofIndex: number

FieldDescriptorProto oneofIndex.

Implementation of#

IFieldDescriptorProto.oneofIndex


options#

Optional options: null | IFieldOptions

FieldDescriptorProto options.

Implementation of#

IFieldDescriptorProto.options


type#

type: Type

FieldDescriptorProto type.

Implementation of#

IFieldDescriptorProto.type


typeName#

typeName: string

FieldDescriptorProto typeName.

Implementation of#

IFieldDescriptorProto.typeName

Methods#

toJSON#

toJSON(): Object

Converts this FieldDescriptorProto to JSON.

Returns#

Object

JSON object


decode#

Static decode(reader, length?): FieldDescriptorProto

Decodes a FieldDescriptorProto message from the specified reader or buffer.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?number-

Returns#

FieldDescriptorProto

FieldDescriptorProto


decodeDelimited#

Static decodeDelimited(reader): FieldDescriptorProto

Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns#

FieldDescriptorProto

FieldDescriptorProto


encode#

Static encode(message, writer?): Writer

Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.

Parameters#

NameTypeDescription
messageIFieldDescriptorProtoFieldDescriptorProto message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


encodeDelimited#

Static encodeDelimited(message, writer?): Writer

Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.

Parameters#

NameTypeDescription
messageIFieldDescriptorProtoFieldDescriptorProto message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


fromObject#

Static fromObject(object): FieldDescriptorProto

Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.

Parameters#

NameTypeDescription
objectObjectPlain object

Returns#

FieldDescriptorProto

FieldDescriptorProto


toObject#

Static toObject(message, options?): Object

Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.

Parameters#

NameTypeDescription
messageFieldDescriptorProtoFieldDescriptorProto
options?IConversionOptions-

Returns#

Object

Plain object