Skip to main content

Class: FieldOptions

google.protobuf.FieldOptions

Represents a FieldOptions.

Implements

Constructors

constructor

new FieldOptions(properties?): FieldOptions

Constructs a new FieldOptions.

Parameters

NameTypeDescription
properties?IFieldOptionsProperties to set

Returns

FieldOptions

Properties

ctype

ctype: CType

FieldOptions ctype.

Implementation of

IFieldOptions.ctype


deprecated

deprecated: boolean

FieldOptions deprecated.

Implementation of

IFieldOptions.deprecated


jstype

jstype: JSType

FieldOptions jstype.

Implementation of

IFieldOptions.jstype


lazy

lazy: boolean

FieldOptions lazy.

Implementation of

IFieldOptions.lazy


packed

packed: boolean

FieldOptions packed.

Implementation of

IFieldOptions.packed


uninterpretedOption

uninterpretedOption: IUninterpretedOption[]

FieldOptions uninterpretedOption.

Implementation of

IFieldOptions.uninterpretedOption


weak

weak: boolean

FieldOptions weak.

Implementation of

IFieldOptions.weak

Methods

toJSON

toJSON(): Object

Converts this FieldOptions to JSON.

Returns

Object

JSON object


create

create(properties?): FieldOptions

Creates a new FieldOptions instance using the specified properties.

Parameters

NameTypeDescription
properties?IFieldOptionsProperties to set

Returns

FieldOptions

FieldOptions instance


decode

decode(reader, length?): FieldOptions

Decodes a FieldOptions message from the specified reader or buffer.

Parameters

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

Returns

FieldOptions

FieldOptions

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): FieldOptions

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

FieldOptions

FieldOptions

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 FieldOptions message. Does not implicitly google.protobuf.FieldOptions.verify|verify messages.

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): FieldOptions

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

FieldOptions

FieldOptions


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for FieldOptions

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 FieldOptions message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageFieldOptionsFieldOptions
options?IConversionOptionsConversion options

Returns

Object

Plain object