public static Object fetchFieldValue(Object entity, Field field) {
try {
return field.get(entity);
} catch (IllegalArgumentException e) {
throw new TypeMismatchException("Entity="+entity.getClass()+" was passed to field of a different type. field type="+field.getType(), e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}