/** * Gets a builder for the field. If no builder has been created yet, a * builder is created on demand by calling {@link Message#toBuilder}. * * @return The builder for the field */ @SuppressWarnings("unchecked") public BType getBuilder() { if (builder == null) { // builder.mergeFrom() on a fresh builder // does not create any sub-objects with independent clean/dirty states, // therefore setting the builder itself to clean without actually calling // build() cannot break any invariants. builder = (BType) message.newBuilderForType(this); builder.mergeFrom(message); // no-op if message is the default message builder.markClean(); } return builder; }
/** * Gets a builder for the field. If no builder has been created yet, a * builder is created on demand by calling {@link Message#toBuilder}. * * @return The builder for the field */ @SuppressWarnings("unchecked") public BType getBuilder() { if (builder == null) { // builder.mergeFrom() on a fresh builder // does not create any sub-objects with independent clean/dirty states, // therefore setting the builder itself to clean without actually calling // build() cannot break any invariants. builder = (BType) message.newBuilderForType(this); builder.mergeFrom(message); // no-op if message is the default message builder.markClean(); } return builder; }
/** * Gets a builder for the field. If no builder has been created yet, a * builder is created on demand by calling {@link Message#toBuilder}. * * @return The builder for the field */ @SuppressWarnings("unchecked") public BType getBuilder() { if (builder == null) { // builder.mergeFrom() on a fresh builder // does not create any sub-objects with independent clean/dirty states, // therefore setting the builder itself to clean without actually calling // build() cannot break any invariants. builder = (BType) message.newBuilderForType(this); builder.mergeFrom(message); // no-op if message is the default message builder.markClean(); } return builder; }
/** * Gets a builder for the field. If no builder has been created yet, a * builder is created on demand by calling {@link Message#toBuilder}. * * @return The builder for the field */ @SuppressWarnings("unchecked") public BType getBuilder() { if (builder == null) { // builder.mergeFrom() on a fresh builder // does not create any sub-objects with independent clean/dirty states, // therefore setting the builder itself to clean without actually calling // build() cannot break any invariants. builder = (BType) message.newBuilderForType(this); builder.mergeFrom(message); // no-op if message is the default message builder.markClean(); } return builder; }
/** * Called by the subclass when a message is built. */ protected void onBuilt() { if (builderParent != null) { markClean(); } }
/** * Called by the subclass when a message is built. */ protected void onBuilt() { if (builderParent != null) { markClean(); } }
/** * Called by the subclass when a message is built. */ protected void onBuilt() { if (builderParent != null) { markClean(); } }
/** * Called by the subclass when a message is built. */ protected void onBuilt() { if (builderParent != null) { markClean(); } }