in core/src/main/java/com/twitter/elephantbird/util/Protobufs.java [328:372]
private static void writeSingleFieldNoTag(CodedOutputStream output,
FieldDescriptor fd,
Object value)
throws IOException {
switch (fd.getType()) {
case DOUBLE:
output.writeDoubleNoTag((Double) value); break;
case FLOAT:
output.writeFloatNoTag((Float) value); break;
case INT64:
case UINT64:
output.writeInt64NoTag((Long) value); break;
case INT32:
output.writeInt32NoTag((Integer) value); break;
case FIXED64:
output.writeFixed64NoTag((Long) value); break;
case FIXED32:
output.writeFixed32NoTag((Integer) value); break;
case BOOL:
output.writeBoolNoTag((Boolean) value); break;
case STRING:
output.writeStringNoTag((String) value); break;
case GROUP:
case MESSAGE:
output.writeMessageNoTag((Message) value); break;
case BYTES:
output.writeBytesNoTag((ByteString) value); break;
case UINT32:
output.writeUInt32NoTag((Integer) value); break;
case ENUM:
output.writeEnumNoTag(((ProtocolMessageEnum) value).getNumber()); break;
case SFIXED32:
output.writeSFixed32NoTag((Integer) value); break;
case SFIXED64:
output.writeSFixed64NoTag((Long) value); break;
case SINT32:
output.writeSInt32NoTag((Integer) value); break;
case SINT64:
output.writeSInt64NoTag((Integer) value); break;
default:
throw new IllegalArgumentException("Unknown type " + fd.getType()
+ " for " + fd.getFullName());
}
}