implements a structure that a protocol message uses to hold a single field of another protocol message. It supports the classical use case of setting an immutable Message as the value of the field and is highly optimized around this.
It also supports the additional use case of setting a Message.Builder as the field and deferring conversion of that
to an immutable
. In this way, it's possible to maintain a tree of
's that acts as a fully read/write data structure.
Logically, one can think of a tree of builders as converting the entire tree to messages when build is called on the root or when any method is called that desires a Message instead of a Builder. In terms of the implementation, the
and
classes cache messages that were created so that messages only need to be created when some change occurred in its builder or a builder for one of its descendants.
<MType> | the type of message for the field |
<BType> | the type of builder for the field |
<IType> | the common interface for the message and the builder |
Definition at line 55 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java.