view gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java @ 700:89ade245ca7a

Using unix line endings only. gnv/trunk@940 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 18 Apr 2010 09:27:11 +0000
parents af22fa5567a6
children d5d4dbda17cc
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