@Test public void testToBuilder() throws Exception { final IBuilder2 builder = messageProvider.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.setAllFieldsViaReflection(builder); final int unknownFieldNum = 9; final long unknownFieldVal = 90; builder.setUnknownFields(UnknownFieldSet .newBuilder() .addField(unknownFieldNum, UnknownFieldSet.Field.newBuilder().addVarint(unknownFieldVal).build()).build()); final Message message = builder.build(); final Message derived = message.toBuilder().build(); reflectionTester.assertAllFieldsSetViaReflection(derived); assertEquals(Arrays.asList(unknownFieldVal), derived.getUnknownFields().getField(unknownFieldNum).getVarintList()); }
@Override public Builder toBuilder() { return newBuilderForType().mergeFrom(this); }
DynamicMessage implements Message, IMessageEx { @Override public Builder toBuilder() { return newBuilderForType().mergeFrom(this); } }
DynamicMessage implements Message, IMessageEx { @Override public Builder toBuilder() { return newBuilderForType().mergeFrom(this); } private  DynamicMessage(final com.google.protobuf.DynamicMessage message); }
DynamicMessage implements Message, IMessageEx { @Override public Builder toBuilder() { return newBuilderForType().mergeFrom(this); } private  DynamicMessage(final com.google.protobuf.DynamicMessage message); static DynamicMesageProvider getProvider(); @Override DynamicMesageProvider getProviderForType(); static DynamicMessage getDefaultInstance(final Descriptor type); static DynamicMessage parseFrom(final Descriptor type, final CodedInputStream input); static DynamicMessage parseFrom(final Descriptor type, final CodedInputStream input,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final ByteString data); static DynamicMessage parseFrom(final Descriptor type, final ByteString data,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final byte[] data); static DynamicMessage parseFrom(final Descriptor type, final byte[] data,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final InputStream input); static DynamicMessage parseFrom(final Descriptor type, final InputStream input,
      final ExtensionRegistry extensionRegistry); static Builder newBuilder(final Descriptor type); static Builder newBuilder(final Message prototype); boolean isEmpty(); @Override ByteString toByteString(); @Override byte[] toByteArray(); @Override void writeTo(final OutputStream output); @Override void writeDelimitedTo(final OutputStream output); @Override List<String> findInitializationErrors(); @Override String getInitializationErrorString(); @Override final String toString(); @Override boolean equals(final Object other); @Override Descriptor getDescriptorForType(); @Override DynamicMessage getDefaultInstanceForType(); @Override DynamicMessage getDefaultInstanceForType(final Descriptor descriptor); @Override int hashCode(); @Override Map<FieldDescriptor, Object> getAllFields(); @Override boolean hasField(final FieldDescriptor field); @Override Object getField(final FieldDescriptor field); @Override int getRepeatedFieldCount(final FieldDescriptor field); @Override Object getRepeatedField(final FieldDescriptor field, final int index); @Override UnknownFieldSet getUnknownFields(); @Override boolean isInitialized(); @Override void writeTo(final CodedOutputStream output); @Override int getSerializedSize(); @Override Builder newBuilderForType(); @Override Builder toBuilder(); @Override FieldDescriptor getOneofFieldDescriptor(final OneofDescriptor oneof); @Override boolean hasOneof(final OneofDescriptor oneof); @Override Parser<DynamicMessage> getParserForType(); }
DynamicMessage implements Message, IMessageEx { @Override public Builder toBuilder() { return newBuilderForType().mergeFrom(this); } private  DynamicMessage(final com.google.protobuf.DynamicMessage message); static DynamicMesageProvider getProvider(); @Override DynamicMesageProvider getProviderForType(); static DynamicMessage getDefaultInstance(final Descriptor type); static DynamicMessage parseFrom(final Descriptor type, final CodedInputStream input); static DynamicMessage parseFrom(final Descriptor type, final CodedInputStream input,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final ByteString data); static DynamicMessage parseFrom(final Descriptor type, final ByteString data,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final byte[] data); static DynamicMessage parseFrom(final Descriptor type, final byte[] data,
      final ExtensionRegistry extensionRegistry); static DynamicMessage parseFrom(final Descriptor type, final InputStream input); static DynamicMessage parseFrom(final Descriptor type, final InputStream input,
      final ExtensionRegistry extensionRegistry); static Builder newBuilder(final Descriptor type); static Builder newBuilder(final Message prototype); boolean isEmpty(); @Override ByteString toByteString(); @Override byte[] toByteArray(); @Override void writeTo(final OutputStream output); @Override void writeDelimitedTo(final OutputStream output); @Override List<String> findInitializationErrors(); @Override String getInitializationErrorString(); @Override final String toString(); @Override boolean equals(final Object other); @Override Descriptor getDescriptorForType(); @Override DynamicMessage getDefaultInstanceForType(); @Override DynamicMessage getDefaultInstanceForType(final Descriptor descriptor); @Override int hashCode(); @Override Map<FieldDescriptor, Object> getAllFields(); @Override boolean hasField(final FieldDescriptor field); @Override Object getField(final FieldDescriptor field); @Override int getRepeatedFieldCount(final FieldDescriptor field); @Override Object getRepeatedField(final FieldDescriptor field, final int index); @Override UnknownFieldSet getUnknownFields(); @Override boolean isInitialized(); @Override void writeTo(final CodedOutputStream output); @Override int getSerializedSize(); @Override Builder newBuilderForType(); @Override Builder toBuilder(); @Override FieldDescriptor getOneofFieldDescriptor(final OneofDescriptor oneof); @Override boolean hasOneof(final OneofDescriptor oneof); @Override Parser<DynamicMessage> getParserForType();  }