Function getExtension

  • Retrieve an extension value from a message.

    The function never returns undefined. Use hasExtension() to check whether an extension is set. If the extension is not set, this function returns the default value (if one was specified in the protobuf source), or the zero value (for example 0 for numeric types, [] for repeated extension fields, and an empty message instance for message fields).

    Extensions are stored as unknown fields on a message. To mutate an extension value, make sure to store the new value with setExtension() after mutating.

    If the extension does not extend the given message, an error is raised.

    Type Parameters

    Parameters

    Returns V