Beispiel #1
0
 @Override
 public void encode(ProtoWriter writer, RedactedChild value) throws IOException {
   if (value.a != null) ProtoAdapter.STRING.encodeWithTag(writer, 1, value.a);
   if (value.b != null) Redacted.ADAPTER.encodeWithTag(writer, 2, value.b);
   if (value.c != null) NotRedacted.ADAPTER.encodeWithTag(writer, 3, value.c);
   writer.writeBytes(value.unknownFields());
 }
Beispiel #2
0
 @Override
 public void encode(ProtoWriter writer, FooBar value) throws IOException {
   if (value.foo != null) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.foo);
   if (value.bar != null) ProtoAdapter.STRING.encodeWithTag(writer, 2, value.bar);
   if (value.baz != null) Nested.ADAPTER.encodeWithTag(writer, 3, value.baz);
   if (value.qux != null) ProtoAdapter.UINT64.encodeWithTag(writer, 4, value.qux);
   if (value.fred != null) ProtoAdapter.FLOAT.asRepeated().encodeWithTag(writer, 5, value.fred);
   if (value.daisy != null) ProtoAdapter.DOUBLE.encodeWithTag(writer, 6, value.daisy);
   if (value.nested != null) FooBar.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.nested);
   if (value.ext != null) FooBarBazEnum.ADAPTER.encodeWithTag(writer, 101, value.ext);
   if (value.rep != null)
     FooBarBazEnum.ADAPTER.asRepeated().encodeWithTag(writer, 102, value.rep);
   writer.writeBytes(value.unknownFields());
 }
 @Override
 public void encode(ProtoWriter writer, RedactedRequired value) throws IOException {
   ProtoAdapter.STRING.encodeWithTag(writer, 1, value.a);
   writer.writeBytes(value.unknownFields());
 }
Beispiel #4
0
 @Override
 public void encode(ProtoWriter writer, Phone value) throws IOException {
   if (value.number != null) ProtoAdapter.STRING.encodeWithTag(writer, 1, value.number);
   writer.writeBytes(value.unknownFields());
 }
Beispiel #5
0
 @Override
 public void encode(ProtoWriter writer, RedactedExtension value) throws IOException {
   if (value.d != null) ProtoAdapter.STRING.encodeWithTag(writer, 1, value.d);
   if (value.e != null) ProtoAdapter.STRING.encodeWithTag(writer, 2, value.e);
   writer.writeBytes(value.unknownFields());
 }