pbs-middleware-server/src/main/java/com/pbs/middleware/server/features/filetransfer/download/factory/DownloadFactory.java
/**
     * Loads a download for given id and applies all stored events on it.
     */
Loads a download for given id and applies all stored events on it.
Loads a download for given id and applies all stored events on it .
public Optional<Download> find(UUID id) {
        List<DownloadEvent> events = repository.findAllByDomainId(id);
        if (events.isEmpty()) {
            return empty();
        }
        Download download = new Download(id, publisher);
        events.forEach(download::apply);
        return of(download);
    }
public Optional < Download > find ( UUID id ) { List < DownloadEvent > events = repository . findAllByDomainId ( id ) ; if ( events . isEmpty ( ) ) { return empty ( ) ; } Download download = new Download ( id , publisher ) ; events . forEach ( download :: apply ) ; return of ( download ) ; }
Loads a download for given id and applies all stored events on it.
Loads a download for given id and applies all stored events on it .