Class: Unpack

Unpack(any)

An packer of string, number, boolean, and message values from Protobuf `Any`.

Constructor

new Unpack(any)

Parameters:
Name Type Description
any Any a Protobuf `Any` value to be unpacked to message or primitive
Source:

Methods

as(typenon-null) → {Message}

Unpacks a Protobuf `Any` assuming it a message of the provided type.
Parameters:
Name Type Description
type Type a type used to deserialize `Any` encompassed in this unpacker
Source:
Returns:
a protobuf message wrapped in `Any` deserialized using the provided type
Type
Message

asBool() → {boolean}

Unpacks a Protobuf `Any` assuming it contains a boolean value.
Source:
Returns:
Type
boolean

asDouble() → {number}

Unpacks a Protobuf `Any` assuming it contains a double value.
Source:
Returns:
Type
number

asFloat() → {number}

Unpacks a Protobuf `Any` assuming it contains a float value.
Source:
Returns:
Type
number

asInt32() → {Number}

Unpacks a Protobuf `Any` assuming it contains an int32 value.
Source:
Returns:
Type
Number

asInt64() → {Number}

Unpacks a Protobuf `Any` assuming it contains an int64 value.
Source:
Returns:
Type
Number

asString() → {String}

Unpacks a Protobuf `Any` assuming it contains a string value.
Source:
Returns:
Type
String

asUInt32() → {Number}

Unpacks a Protobuf `Any` assuming it contains an unsigned int32 value.
Source:
Returns:
Type
Number

asUInt64() → {Number}

Unpacks a Protobuf `Any` assuming it contains an unsigned int64 value.
Source:
Returns:
Type
Number