@Test public void testSetMessage() { builder.setMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); assertEquals(0, builder.getMessage().getField(OPTIONAL_INT32)); builder.getBuilder().setField(OPTIONAL_INT32, 1); assertEquals(0, mockParent.getInvalidationCount()); assertEquals(1, builder.getBuilder().getField(OPTIONAL_INT32)); assertEquals(1, builder.getMessage().getField(OPTIONAL_INT32)); builder.build(); builder.getBuilder().setField(OPTIONAL_INT32, 2); assertEquals(2, builder.getBuilder().getField(OPTIONAL_INT32)); assertEquals(2, builder.getMessage().getField(OPTIONAL_INT32)); assertSame(builder.getMessage(), builder.getMessage()); }
public SingleFieldBuilder<MType, BType, IType> setMessage(final MType message) { if (message == null) { throw new NullPointerException(); } this.message = message; if (builder != null) { dispose(builder); builder = null; } onChanged(); return this; }
SingleFieldBuilder implements BuilderParent, IFieldBuilder { public SingleFieldBuilder<MType, BType, IType> setMessage(final MType message) { if (message == null) { throw new NullPointerException(); } this.message = message; if (builder != null) { dispose(builder); builder = null; } onChanged(); return this; } }
SingleFieldBuilder implements BuilderParent, IFieldBuilder { public SingleFieldBuilder<MType, BType, IType> setMessage(final MType message) { if (message == null) { throw new NullPointerException(); } this.message = message; if (builder != null) { dispose(builder); builder = null; } onChanged(); return this; } SingleFieldBuilder(final MType message, final BuilderParent parent, final boolean isClean); }
SingleFieldBuilder implements BuilderParent, IFieldBuilder { public SingleFieldBuilder<MType, BType, IType> setMessage(final MType message) { if (message == null) { throw new NullPointerException(); } this.message = message; if (builder != null) { dispose(builder); builder = null; } onChanged(); return this; } SingleFieldBuilder(final MType message, final BuilderParent parent, final boolean isClean); @Override BuilderParent getParent(); @Override void dispose(); @SuppressWarnings("unchecked") MType getMessage(); @Override MType build(); BType getBuilder(); @SuppressWarnings("unchecked") IType getMessageOrBuilder(); SingleFieldBuilder<MType, BType, IType> setMessage(final MType message); SingleFieldBuilder<MType, BType, IType> mergeFrom(final MType value); @Override @SuppressWarnings("unchecked") void clear(); @Override void markDirty(); @Override boolean isInitialized(); }
SingleFieldBuilder implements BuilderParent, IFieldBuilder { public SingleFieldBuilder<MType, BType, IType> setMessage(final MType message) { if (message == null) { throw new NullPointerException(); } this.message = message; if (builder != null) { dispose(builder); builder = null; } onChanged(); return this; } SingleFieldBuilder(final MType message, final BuilderParent parent, final boolean isClean); @Override BuilderParent getParent(); @Override void dispose(); @SuppressWarnings("unchecked") MType getMessage(); @Override MType build(); BType getBuilder(); @SuppressWarnings("unchecked") IType getMessageOrBuilder(); SingleFieldBuilder<MType, BType, IType> setMessage(final MType message); SingleFieldBuilder<MType, BType, IType> mergeFrom(final MType value); @Override @SuppressWarnings("unchecked") void clear(); @Override void markDirty(); @Override boolean isInitialized();  }