001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.plugins.eventbus.gui.download;
003
004import java.util.EventObject;
005import java.util.Objects;
006
007import org.openstreetmap.josm.gui.download.DownloadSource;
008
009/**
010 * Event fired when a download source is added.
011 */
012public class DownloadSourceAddedEvent extends EventObject {
013
014    private static final long serialVersionUID = 1L;
015
016    private final DownloadSource<?> downloadSource;
017
018    /**
019     * Constructs a new {@code DownloadSourceAddedEvent}.
020     * @param source object on which the Event initially occurred
021     * @param downloadSource new download source
022     */
023    public DownloadSourceAddedEvent(Object source, DownloadSource<?> downloadSource) {
024        super(source);
025        this.downloadSource = Objects.requireNonNull(downloadSource);
026    }
027
028    /**
029     * Returns the added download source.
030     * @return the added download source
031     */
032    public DownloadSource<?> getDownloadSource() {
033        return downloadSource;
034    }
035}