/*
 * The Exomiser - A tool to annotate and prioritize genomic variants
 *
 * Copyright (c) 2016-2017 Queen Mary University of London.
 * Copyright (c) 2012-2016 Charité Universitätsmedizin Berlin and Genome Research Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.monarchinitiative.exomiser.data.genome.model;

import org.monarchinitiative.exomiser.data.genome.archive.AlleleArchive;
import org.monarchinitiative.exomiser.data.genome.parsers.AlleleParser;

import java.util.Objects;

/**
 * Data class for defining the resources required for processing an allele data set in the application.
 *
 * @author Jules Jacobsen <j.jacobsen@qmul.ac.uk>
 */
public class AlleleResource {

    private final String name;
    private final AlleleArchive alleleArchive;
    private final AlleleParser alleleParser;

    public AlleleResource(String name, AlleleArchive alleleArchive, AlleleParser alleleParser) {
        this.name = name;
        this.alleleArchive = alleleArchive;
        this.alleleParser = alleleParser;
    }

    public String getName() {
        return name;
    }

    public AlleleArchive getAlleleArchive() {
        return alleleArchive;
    }

    public AlleleParser getAlleleParser() {
        return alleleParser;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AlleleResource that = (AlleleResource) o;
        return Objects.equals(name, that.name) &&
                Objects.equals(alleleArchive, that.alleleArchive) &&
                Objects.equals(alleleParser, that.alleleParser);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, alleleArchive, alleleParser);
    }

    @Override
    public String toString() {
        return "AlleleResource{" +
                "name='" + name + '\'' +
                ", alleleArchive=" + alleleArchive +
                ", alleleParser=" + alleleParser +
                '}';
    }
}

@@ -1095,16 +1095,37 @@
 arser;%0A%0A
+import java.net.URL;%0A
 import j
@@ -1366,24 +1366,59 @@
 tring name;%0A
+    private final URL resourceUrl;%0A
     private 
@@ -1536,16 +1536,33 @@
 ng name,
+ URL resourceUrl,
  AlleleA
@@ -1634,24 +1634,64 @@
 ame = name;%0A
+        this.resourceUrl = resourceUrl;%0A
         this
@@ -1821,32 +1821,101 @@
 rn name;%0A    %7D%0A%0A
+    public URL getResourceUrl() %7B%0A        return resourceUrl;%0A    %7D%0A%0A
     public Allel
@@ -2312,24 +2312,89 @@
 at.name) &&%0A
+                Objects.equals(resourceUrl, that.resourceUrl) &&%0A
             
@@ -2597,16 +2597,29 @@
 sh(name,
+ resourceUrl,
  alleleA
@@ -2769,16 +2769,65 @@
  '%5C'' +%0A
+                %22, resourceUrl=%22 + resourceUrl +%0A
         

Add URL to AlleleResource