@Override
public OneOfEverything read(TProtocol protocol)
throws Exception
{
TProtocolReader reader = new TProtocolReader(protocol);
boolean aBoolean = false;
byte aByte = 0;
short aShort = 0;
int aInt = 0;
long aLong = 0;
double aDouble = 0;
String aString = null;
BonkField aStruct = null;
Fruit aEnum = null;
UnionField aUnion = null;
reader.readStructBegin();
while (reader.nextField()) {
switch (reader.getFieldId()) {
case 1:
aBoolean = reader.readBoolField();
break;
case 2:
aByte = reader.readByteField();
break;
case 3:
aShort = reader.readI16Field();
break;
case 4:
aInt = reader.readI32Field();
break;
case 5:
aLong = reader.readI64Field();
break;
case 6:
aDouble = reader.readDoubleField();
break;
case 7:
aString = reader.readStringField();
break;
case 8:
aStruct = reader.readStructField(aStructCodec);
break;
case 9:
aEnum = reader.readEnumField(aFruitCodec);
break;
case 60:
aUnion = reader.readStructField(aUnionCodec);
default:
reader.skipFieldData();
}
}
reader.readStructEnd();
OneOfEverything oneOfEverything = new OneOfEverything();
oneOfEverything.aBoolean = aBoolean;
oneOfEverything.aByte = aByte;
oneOfEverything.aShort = aShort;