in finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/Span.java [883:988]
public void read(org.apache.thrift.protocol.TProtocol iprot, Span struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TRACE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.trace_id = iprot.readI64();
struct.setTrace_idIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // PARENT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.parent_id = iprot.readI64();
struct.setParent_idIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // ANNOTATIONS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.annotations = new java.util.ArrayList<Annotation>(_list0.size);
Annotation _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = new Annotation();
_elem1.read(iprot);
struct.annotations.add(_elem1);
}
iprot.readListEnd();
}
struct.setAnnotationsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // BINARY_ANNOTATIONS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
struct.binary_annotations = new java.util.ArrayList<BinaryAnnotation>(_list3.size);
BinaryAnnotation _elem4;
for (int _i5 = 0; _i5 < _list3.size; ++_i5)
{
_elem4 = new BinaryAnnotation();
_elem4.read(iprot);
struct.binary_annotations.add(_elem4);
}
iprot.readListEnd();
}
struct.setBinary_annotationsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // DEBUG
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.debug = iprot.readBool();
struct.setDebugIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // TIMESTAMP
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.timestamp = iprot.readI64();
struct.setTimestampIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}