*/
private <T> T mapResourceToObject(final Resource resource, final T object) {
ValueMap valueMap = resource.adaptTo(ValueMap.class);
try {
Class<?> type = object.getClass();
MapperStrategy mapperStrategy = mapperStrategyFactory.getMapperStrategy(type);
Field[] fields = ReflectionHelper.readAllDeclaredFields(type);
for (Field field : fields) {
if (shouldFieldBeMapped(field, mapperStrategy)) {
Object value = mapResourceToField(resource, valueMap, field);
FieldUtils.writeField(field, object, value, ReflectionHelper.FORCE_ACCESS);