Search in sources :

Example 1 with DocumentType

use of com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentType in project cia by Hack23.

the class RiksdagenImportServiceImpl method getDocumentElementMap.

@Override
public Map<String, String> getDocumentElementMap(final Date after, final List<DocumentType> downloadType, final boolean onlyWithDocStatus) {
    final List<DocumentElement> all = documentElementDAO.getAll();
    final List<String> documentTypeValues = new ArrayList<>();
    for (final DocumentType docType : downloadType) {
        documentTypeValues.add(docType.value());
    }
    final Map<String, String> map = new ConcurrentHashMap<>();
    for (final DocumentElement documentElement : all) {
        if (checkIncludeDate(after, documentTypeValues, documentElement) && checkIncludeStatus(onlyWithDocStatus, documentElement)) {
            map.put(documentElement.getId(), documentElement.getDocumentType());
        }
    }
    return map;
}
Also used : DocumentElement(com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement) ArrayList(java.util.ArrayList) DocumentType(com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentType) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Aggregations

DocumentElement (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement)1 DocumentType (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentType)1 ArrayList (java.util.ArrayList)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1