class VirtualDataSourceResourceConverter extends ResourceConverterImpl<VirtualReportDataSource, ClientVirtualDataSource> {

    @Override
    protected ClientVirtualDataSource resourceSpecificFieldsToClient(ClientVirtualDataSource client, VirtualReportDataSource serverObject, ToClientConversionOptions options) {
        final Map<String,ResourceReference> dataSourceUriMap = serverObject.getDataSourceUriMap();
        List<ClientSubDataSourceReference> subDataSources = null;
        if(dataSourceUriMap != null && !dataSourceUriMap.isEmpty()){
            subDataSources = new ArrayList<ClientSubDataSourceReference>(dataSourceUriMap.size());
            for(String currentId : dataSourceUriMap.keySet()){
                final ClientSubDataSourceReference currentReference = new ClientSubDataSourceReference();
                currentReference.setId(currentId);
                currentReference.setUri(dataSourceUriMap.get(currentId).getReferenceURI());
                subDataSources.add(currentReference);
            }
        }
        client.setSubDataSources(subDataSources);
        return client;
    }

}