Sets all int fields in an object to 0.
try {
final Integer value = new Integer(0);
Field[] fields = obj.getClass()
.getFields();
for (int idx = 0; idx < fields.length; idx++) {
if (fields[idx].getType() == int.class) {
fields[idx].set(obj, value);
}
}
} catch (final IllegalAccessException ex) {
throw new RuntimeException(ex);
}