view gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java @ 693:d4d1eb56d725

Added more JavaDocs gnv/trunk@919 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Apr 2010 12:10:15 +0000
parents 254f062e334b
children af22fa5567a6
line wrap: on
line source
package de.intevation.gnv.artifactdatabase.objects;

/**
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 */
public class ArtifactFactory implements ArtifactObject {

    /**
     * The UID of this Class.
     */
    private static final long serialVersionUID = 5453748230625831527L;

    private String name = null;

    private String description = null;

    private boolean selected = false;

    private String dataBaseUrl = null;

    /**
     * Returns the url of the artifact server.
     * 
     * @return the dataBaseUrl
     */
    public String getDataBaseUrl() {
        return dataBaseUrl;
    }

    /**
     * Constructor
     * @param name the name of the factory
     * @param description the description of the Factory
     * @param dataBaseUrl the URL where the Factory could be reached.
     */
    public ArtifactFactory(String name, String description, String dataBaseUrl) {
        super();
        this.name = name;
        this.description = description;
        this.dataBaseUrl = dataBaseUrl;
    }


    public String getId() {
        return this.name;
    }


    public boolean isSelected() {

        return this.selected;
    }


    public void setSelected(boolean selected) {
        this.selected = selected;
    }


    public String getName() {
        return name;
    }


    public String getDescription() {
        return description;
    }


    public String getHash() {
        return null;
    }

    /**
     * Two ArtifactFactories are equal, if the name and the url to the artifact
     * server are equal.
     * 
     * @param obj
     * @return true, if the factories are equal - otherwise false.
     */
    @Override
    public boolean equals(Object obj) {
        boolean returnValue = false;
        if (obj instanceof ArtifactFactory){
            ArtifactFactory af = (ArtifactFactory)obj;
            returnValue = this.getName().equals(af.getName()) &&
                          this.getDataBaseUrl().equals(af.getDataBaseUrl());
        }
        return returnValue;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org