com.google.protobuf.GeneratedMessageV3.ExtendableBuilder< MessageType extends ExtendableMessage, BuilderType extends ExtendableBuilder< MessageType, BuilderType > Class Template Referenceabstract

Detailed Description

Generated message builders for message types that contain extension ranges subclass this.

This class implements type-safe accessors for extensions. They implement all the same operations that you can do with normal fields – e.g. "get", "set", and "add" – but for extensions. The extensions are identified using instances of the class GeneratedExtension; the protocol compiler generates a static instance of this class for every extension in its input. Through the magic of generics, all is made type-safe.

For example, imagine you have the

.proto

file:

option java_class = "MyProto";
message Foo {
  extensions 1000 to max;
}
extend Foo {
  optional int32 bar;
}

Then you might write code like:

MyProto.Foo foo =
  MyProto.Foo.newBuilder()
    .setExtension(MyProto.bar, 123)
    .build();

See also ExtendableMessage.

Definition at line 1360 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java.


The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:05