ExtensionRegistry class

A registry of Extensions, looked up by (extendee, number) and by Any-style type-url.

Generated code emits one registry per file and merges them (via merge) for option resolution and Any-in-JSON, mirroring protobuf-es's registry API and protobuf-go's protoregistry.

Constructors

ExtensionRegistry()
Creates an empty registry.
ExtensionRegistry.of(Iterable<Extension> extensions)
Creates a registry pre-populated with extensions.
factory

Properties

extensions Iterable<Extension>
All registered extensions.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

lookup(String extendeeFullName, int number) Extension?
Looks up an extension by its extendeeFullName and field number, or null when none is registered.
lookupByTypeUrl(String typeUrl) Extension?
Looks up an extension by Any-style typeUrl (the part after the final / is matched against the extension's fully-qualified name), or null when none is registered. A bare fully-qualified name is also accepted.
merge(ExtensionRegistry other) → void
Merges other into this registry (entries from other win on conflict).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(Extension extension) → void
Registers extension for lookup by (extendee, number) and by type-url.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited