@SuppressWarnings("unchecked")
private Object convertMap(MappedPath propertyPath, Set<? extends NODE> values) {
MappedProperty<?> propertyDefinition = propertyPath.getMappedProperty();
Object convertedValue;
Class<?> componentType = propertyDefinition.getComponentType();
Class<?> keyType = propertyDefinition.getKeyType();
Map map = new HashMap();
for (NODE value : values) {
Object key = convertValue(
getFunctionalValue((ID) value, propertyDefinition.getKeyPredicate(), false, null), keyType, propertyPath);
Object mapValue;
UID valuePredicate = propertyDefinition.getValuePredicate();
if (valuePredicate != null) {
mapValue = convertValue(getFunctionalValue((ID) value, valuePredicate, false, null), componentType, propertyPath);
} else {
mapValue = convertValue(value, componentType, propertyPath);
}
map.put(key, mapValue);
}
convertedValue = map;
return convertedValue;
}