}
}
// builder method
if (metadata.getBuilderMethod().isPresent()) {
ThriftMethodInjection builderMethod = metadata.getBuilderMethod().get();
Object[] parametersValues = new Object[] { data.getValue() };
try {
instance = builderMethod.getMethod().invoke(instance, parametersValues);
checkState(instance != null, "Builder method returned a null instance");
checkState(metadata.getStructClass().isInstance(instance),
"Builder method returned instance of type %s, but an instance of %s is required",
instance.getClass().getName(),
metadata.getStructClass().getName());