class VirtualDataSourceResourceConverter extends ResourceConverterImpl<VirtualReportDataSource, ClientVirtualDataSource> {

    @Override
    protected VirtualReportDataSource resourceSpecificFieldsToServer(ClientVirtualDataSource clientObject, VirtualReportDataSource resultToUpdate, List<Exception> exceptions, ToServerConversionOptions options) throws IllegalParameterValueException {
        final List<ClientSubDataSourceReference> subDataSources = clientObject.getSubDataSources();
        Map<String,ResourceReference> dataSourceUriMap = Collections.EMPTY_MAP;
        if(subDataSources != null && !subDataSources.isEmpty()){
            dataSourceUriMap = new HashMap<String, ResourceReference>(subDataSources.size());
            for(ClientSubDataSourceReference currentReference : subDataSources){
                dataSourceUriMap.put(currentReference.getId(), new ResourceReference(currentReference.getUri()));
            }
        }

        resultToUpdate.setDataSourceUriMap(dataSourceUriMap);
        return resultToUpdate;
    }

}