{
write.loadVariable("struct");
if (field.getExtraction().isPresent()) {
ThriftExtraction extraction = field.getExtraction().get();
if (extraction instanceof ThriftFieldExtractor) {
ThriftFieldExtractor fieldExtractor = (ThriftFieldExtractor) extraction;
write.getField(fieldExtractor.getField());
if (fieldExtractor.isGeneric()) {
write.checkCast(type(fieldExtractor.getType()));
}
}
else if (extraction instanceof ThriftMethodExtractor) {
ThriftMethodExtractor methodExtractor = (ThriftMethodExtractor) extraction;
write.invokeVirtual(methodExtractor.getMethod());