Skip to main content

Class: FieldDescriptorProto

google.protobuf.FieldDescriptorProto

Represents a FieldDescriptorProto.

Implements

Constructors

constructor

new FieldDescriptorProto(properties?): FieldDescriptorProto

Constructs a new FieldDescriptorProto.

Parameters

NameTypeDescription
properties?IFieldDescriptorProtoProperties to set

Returns

FieldDescriptorProto

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


create

create(properties?): FieldDescriptorProto

Creates a new FieldDescriptorProto instance using the specified properties.

Parameters

NameTypeDescription
properties?IFieldDescriptorProtoProperties to set

Returns

FieldDescriptorProto

FieldDescriptorProto instance


decode

decode(reader, length?): FieldDescriptorProto

Decodes a FieldDescriptorProto message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

FieldDescriptorProto

FieldDescriptorProto

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): FieldDescriptorProto

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

FieldDescriptorProto

FieldDescriptorProto

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified FieldDescriptorProto message. Does not implicitly google.protobuf.FieldDescriptorProto.verify|verify messages.

Parameters

NameTypeDescription
messageIFieldDescriptorProtoFieldDescriptorProto message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

NameTypeDescription
messageIFieldDescriptorProtoFieldDescriptorProto message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for FieldDescriptorProto

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageFieldDescriptorProtoFieldDescriptorProto
options?IConversionOptionsConversion options

Returns

Object

Plain object