class Mapper implements ResourceLoaderAware {

	public Object map(Object toMap) {
		
		if (toMap == null) {
			return null;
		}
		
		Class<?> mappedClass = mappings.get(toMap.getClass());
		if (mappedClass != null) {
			return modelMapper.map(toMap, mappedClass);			
		} else {
			return toMap;
		}
	}

}