예제 #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());
 }
예제 #2
0
 @Override
 public void encode(ProtoWriter writer, MethodOptions value) throws IOException {
   if (value.deprecated != null) ProtoAdapter.BOOL.encodeWithTag(writer, 33, value.deprecated);
   if (value.uninterpreted_option != null)
     UninterpretedOption.ADAPTER
         .asRepeated()
         .encodeWithTag(writer, 999, value.uninterpreted_option);
   writer.writeBytes(value.unknownFields());
 }
예제 #3
0
 @Override
 public void encode(ProtoWriter writer, FieldDescriptorProto value) throws IOException {
   if (value.name != null) ProtoAdapter.STRING.encodeTagged(writer, 1, value.name);
   if (value.doc != null) ProtoAdapter.STRING.encodeTagged(writer, 9, value.doc);
   if (value.number != null) ProtoAdapter.INT32.encodeTagged(writer, 3, value.number);
   if (value.label != null) Label.ADAPTER.encodeTagged(writer, 4, value.label);
   if (value.type != null) Type.ADAPTER.encodeTagged(writer, 5, value.type);
   if (value.type_name != null) ProtoAdapter.STRING.encodeTagged(writer, 6, value.type_name);
   if (value.extendee != null) ProtoAdapter.STRING.encodeTagged(writer, 2, value.extendee);
   if (value.default_value != null)
     ProtoAdapter.STRING.encodeTagged(writer, 7, value.default_value);
   if (value.options != null) FieldOptions.ADAPTER.encodeTagged(writer, 8, value.options);
   writer.writeBytes(value.unknownFields());
 }
예제 #4
0
파일: FooBar.java 프로젝트: pforhan/wire
 @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());
 }
예제 #5
0
 @Override
 public void encode(ProtoWriter writer, DescriptorProto value) throws IOException {
   if (value.name != null) ProtoAdapter.STRING.encodeTagged(writer, 1, value.name);
   if (value.doc != null) ProtoAdapter.STRING.encodeTagged(writer, 8, value.doc);
   if (value.field != null)
     FieldDescriptorProto.ADAPTER.asRepeated().encodeTagged(writer, 2, value.field);
   if (value.extension != null)
     FieldDescriptorProto.ADAPTER.asRepeated().encodeTagged(writer, 6, value.extension);
   if (value.nested_type != null)
     DescriptorProto.ADAPTER.asRepeated().encodeTagged(writer, 3, value.nested_type);
   if (value.enum_type != null)
     EnumDescriptorProto.ADAPTER.asRepeated().encodeTagged(writer, 4, value.enum_type);
   if (value.extension_range != null)
     ExtensionRange.ADAPTER.asRepeated().encodeTagged(writer, 5, value.extension_range);
   if (value.options != null) MessageOptions.ADAPTER.encodeTagged(writer, 7, value.options);
   writer.writeBytes(value.unknownFields());
 }
예제 #6
0
 @Override
 public void encode(ProtoWriter writer, ExtensionRange value) throws IOException {
   if (value.start != null) ProtoAdapter.INT32.encodeTagged(writer, 1, value.start);
   if (value.end != null) ProtoAdapter.INT32.encodeTagged(writer, 2, value.end);
   writer.writeBytes(value.unknownFields());
 }
예제 #7
0
파일: Foos.java 프로젝트: amikey/wire
 @Override
 public void encode(ProtoWriter writer, Foos value) throws IOException {
   if (value.foos != null) Foo.ADAPTER.asRepeated().encodeTagged(writer, 1, value.foos);
   writer.writeBytes(value.unknownFields());
 }
예제 #8
0
 @Override
 public void encode(ProtoWriter writer, RedactedRequired value) throws IOException {
   ProtoAdapter.STRING.encodeWithTag(writer, 1, value.a);
   writer.writeBytes(value.unknownFields());
 }
예제 #9
0
파일: A.java 프로젝트: EddieRingle/wire
 @Override
 public void encode(ProtoWriter writer, A value) throws IOException {
   if (value.c != null) B.ADAPTER.encodeWithTag(writer, 1, value.c);
   if (value.d != null) D.ADAPTER.encodeWithTag(writer, 2, value.d);
   writer.writeBytes(value.unknownFields());
 }
예제 #10
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());
 }
예제 #11
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());
 }
예제 #12
0
파일: FooBar.java 프로젝트: pforhan/wire
 @Override
 public void encode(ProtoWriter writer, More value) throws IOException {
   if (value.serial != null)
     ProtoAdapter.INT32.asRepeated().encodeWithTag(writer, 1, value.serial);
   writer.writeBytes(value.unknownFields());
 }
예제 #13
0
파일: FooBar.java 프로젝트: pforhan/wire
 @Override
 public void encode(ProtoWriter writer, Nested value) throws IOException {
   if (value.value != null) FooBarBazEnum.ADAPTER.encodeWithTag(writer, 1, value.value);
   writer.writeBytes(value.unknownFields());
 }
예제 #14
0
 @Override
 public void encode(ProtoWriter writer, SendDataRequest value) throws IOException {
   if (value.data != null) ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.data);
   writer.writeBytes(value.unknownFields());
 }
예제 #15
0
파일: C.java 프로젝트: crazybob/wire
 @Override
 public void encode(ProtoWriter writer, C value) throws IOException {
   if (value.i != null) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.i);
   writer.writeBytes(value.unknownFields());
 }