private void defineWriteBridgeMethod()
{
Parameter struct = arg("struct", Object.class);
Parameter protocol = arg("protocol", TProtocolWriter.class);
MethodDefinition method = new MethodDefinition(
classDefinition,
a(PUBLIC, BRIDGE, SYNTHETIC),
"write",
null,
struct,
protocol)
.addException(Exception.class);
method.getBody().append(method.getThis()
.invoke("write",
type(void.class),
ImmutableList.of(structType, protocol.getType()),
ImmutableList.of(struct.cast(structType), protocol))
.ret());
classDefinition.addMethod(method);
}