protoObj
protoObj returns an object based on a proto.Message value which handles conversion between protobuf type values and expression type values. Objects support indexing and iteration.
Note: the type value is pulled from the list of registered types within the type provider. If the proto type is not registered within the type provider, then this will result in an error within the type adapter / provider.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new protoObj(
adapter,typeDesc,typeValue,pbValue,reflectedValue):protoObj
Parameters
Section titled “Parameters”adapter
Section titled “adapter”typeDesc
Section titled “typeDesc”DescMessage
typeValue
Section titled “typeValue”pbValue
Section titled “pbValue”Message
reflectedValue
Section titled “reflectedValue”ReflectMessage
Returns
Section titled “Returns”protoObj
Methods
Section titled “Methods”aggregateSize()
Section titled “aggregateSize()”aggregateSize(
sizer):number
aggregateSize implements AggregateSizeVisitor by summing the set fields of the message.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
convertToNative()
Section titled “convertToNative()”convertToNative(
typeDesc):unknown
ConvertToNative converts the Value to a native TypeScript value according to the provided type description, or throws if the conversion is not feasible.
Parameters
Section titled “Parameters”typeDesc
Section titled “typeDesc”unknown
Returns
Section titled “Returns”unknown
Implementation of
Section titled “Implementation of”convertToType()
Section titled “convertToType()”convertToType(
typeVal):Val
ConvertToType supports type conversions between CEL value types supported by the expression language.
Parameters
Section titled “Parameters”typeVal
Section titled “typeVal”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”equal()
Section titled “equal()”equal(
other):Val
Equal returns true if the other value has the same type and content as the implementing value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”format()
Section titled “format()”format(
sb):void
format implements formattable.
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”void
get(
index):Val
Get returns the field value by name.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”isSet()
Section titled “isSet()”isSet(
field):Val
IsSet tests whether a field which is defined is set to a non-default value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”isZeroValue()
Section titled “isZeroValue()”isZeroValue():
boolean
IsZeroValue returns true if the protobuf object is empty.
Returns
Section titled “Returns”boolean
toString()
Section titled “toString()”toString():
string
String returns the human-readable formatted value.
Returns
Section titled “Returns”string
type()
Section titled “type()”type():
RefType
Type returns the TypeValue of the value.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”value()
Section titled “value()”value():
unknown
Value returns the raw value of the instance which may not be directly compatible with the expression language types.
Returns
Section titled “Returns”unknown