docs: public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list,
              boolean withTag) throws IOException {
          if (o == null) {
              return;
          }
  
          if (type == FieldType.OBJECT) {
  
              Class cls = o.getClass();
              Codec target = ProtobufProxy.create(cls);
  
              if (withTag) {
                  out.writeRawVarint32(makeTag(order, WireFormat.WIRETYPE_LENGTH_DELIMITED));
              }
              out.writeRawVarint32(target.size(o));
  
              target.writeTo(o, out);
              return;
          }
  
          if (type == FieldType.BOOL) {
              if (withTag) {
                  out.writeBool(order, (Boolean) o);
              } else {
                  out.writeBoolNoTag((Boolean) o);
              }
          } else if (type == FieldType.BYTES) {
              byte[] bb = (byte[]) o;
              if (withTag) {
                  out.writeBytes(order, ByteString.copyFrom(bb));
              } else {
                  out.writeBytesNoTag(ByteString.copyFrom(bb));
              }
          } else if (type == FieldType.DOUBLE) {
              if (withTag) {
                  out.writeDouble(order, (Double) o);
              } else {
                  out.writeDoubleNoTag((Double) o);
              }
          } else if (type == FieldType.FIXED32) {
              if (withTag) {
                  out.writeFixed32(order, (Integer) o);
              } else {
                  out.writeFixed32NoTag((Integer) o);
              }
          } else if (type == FieldType.FIXED64) {
              if (withTag) {
                  out.writeFixed64(order, (Long) o);
              } else {
                  out.writeFixed64NoTag((Long) o);
              }
          } else if (type == FieldType.FLOAT) {
              if (withTag) {
                  out.writeFloat(order, (Float) o);
              } else {
                  out.writeFloatNoTag((Float) o);
              }
          } else if (type == FieldType.INT32) {
              if (withTag) {
                  out.writeInt32(order, (Integer) o);
              } else {
                  out.writeInt32NoTag((Integer) o);
              }
          } else if (type == FieldType.INT64) {
              if (withTag) {
                  out.writeInt64(order, (Long) o);
              } else {
                  out.writeInt64NoTag((Long) o);
              }
          } else if (type == FieldType.SFIXED32) {
              if (withTag) {
                  out.writeSFixed32(order, (Integer) o);
              } else {
                  out.writeSFixed32NoTag((Integer) o);
              }
          } else if (type == FieldType.SFIXED64) {
              if (withTag) {
                  out.writeSFixed64(order, (Long) o);
              } else {
                  out.writeSFixed64NoTag((Long) o);
              }
          } else if (type == FieldType.SINT32) {
              if (withTag) {
                  out.writeSInt32(order, (Integer) o);
              } else {
                  out.writeSInt32NoTag((Integer) o);
              }
          } else if (type == FieldType.SINT64) {
              if (withTag) {
                  out.writeSInt64(order, (Long) o);
              } else {
                  out.writeSInt64NoTag((Long) o);
              }
          } else if (type == FieldType.STRING) {
              if (withTag) {
                  out.writeBytes(order, ByteString.copyFromUtf8(String.valueOf(o)));
              } else {
                  out.writeBytesNoTag(ByteString.copyFromUtf8(String.valueOf(o)));
              }
          } else if (type == FieldType.UINT32) {
              if (withTag) {
                  out.writeUInt32(order, (Integer) o);
              } else {
                  out.writeUInt32NoTag((Integer) o);
              }
          } else if (type == FieldType.UINT64) {
              if (withTag) {
                  out.writeUInt64(order, (Long) o);
              } else {
                  out.writeUInt64NoTag((Long) o);
              }
          } else if (type == FieldType.ENUM) {
              int value = 0;
              if (o instanceof EnumReadable) {
                  value = ((EnumReadable) o).value();
              } else if (o instanceof Enum) {
                  value = ((Enum) o).ordinal();
              }
              if (withTag) {
                  out.writeEnum(order, value);
  
              } else {
                  out.writeEnumNoTag(value);
              }
          }
      }