/**
* Defines the code to read all of the data from the protocol into local variables.
*/
private Map<Short, LocalVariableDefinition> readFieldValues(MethodDefinition read)
{
LocalVariableDefinition protocol = read.getLocalVariable("reader");
// declare and init local variables here
Map<Short, LocalVariableDefinition> structData = new TreeMap<>();
for (ThriftFieldMetadata field : metadata.getFields(FieldKind.THRIFT_FIELD)) {
LocalVariableDefinition variable = read.addInitializedLocalVariable(
toParameterizedType(field.getThriftType()),
"f_" + field.getName()
);
structData.put(field.getId(), variable);
}