Skip to main content

Class: Value

google.protobuf.Value

Represents a Value.

Implements

Constructors

constructor

new Value(properties?): Value

Constructs a new Value.

Parameters

NameTypeDescription
properties?IValueProperties to set

Returns

Value

Properties

boolValue

Optional boolValue: boolean

Value boolValue.

Implementation of

IValue.boolValue


kind

Optional kind: "nullValue" | "numberValue" | "stringValue" | "boolValue" | "structValue" | "listValue"

Value kind.


listValue

Optional listValue: IListValue

Value listValue.

Implementation of

IValue.listValue


nullValue

Optional nullValue: NULL_VALUE

Value nullValue.

Implementation of

IValue.nullValue


numberValue

Optional numberValue: number

Value numberValue.

Implementation of

IValue.numberValue


stringValue

Optional stringValue: string

Value stringValue.

Implementation of

IValue.stringValue


structValue

Optional structValue: IStruct

Value structValue.

Implementation of

IValue.structValue

Methods

create

create(properties?): Value

Creates a new Value instance using the specified properties.

Parameters

NameTypeDescription
properties?IValueProperties to set

Returns

Value

Value instance


decode

decode(reader, length?): Value

Decodes a Value message from the specified reader or buffer.

Parameters

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

Returns

Value

Value

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Value

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Value

Value

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 Value message. Does not implicitly verify messages.

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Value message, length delimited. Does not implicitly verify messages.

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): Value

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Value

Value


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Value

Parameters

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

Returns

string

The default type url


toJSON

toJSON(): Object

Converts this Value to JSON.

Returns

Object

JSON object


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageValueValue
options?IConversionOptionsConversion options

Returns

Object

Plain object


verify

verify(message): string

Verifies a Value message.

Parameters

NameTypeDescription
messageObjectPlain object to verify

Returns

string

null if valid, otherwise the reason why it is not