Dependency.java :  » IntelliJ » intellij-ivy-plugin » net » sf » ivyide » Java Open Source

Java Open Source » IntelliJ » intellij ivy plugin 
intellij ivy plugin » net » sf » ivyide » Dependency.java
package net.sf.ivyide;

import com.intellij.openapi.roots.DependencyScope;

/**
 * User: janssk1
 * Date: 18-okt-2010
 * Time: 15:01:36
 */
public class Dependency {

    private final ModuleId moduleId;
    private final String revision;
    private final DependencyScope scope;

    public Dependency(ModuleId moduleId, String revision, DependencyScope scope) {
        this.moduleId = moduleId;
        this.revision = revision;
        this.scope = scope;
    }

    public String toString() {
        return moduleId + "#" + revision;
    }

    public String getName() {
        return getModuleId().getName();
    }

    public String getOrganisation() {
        return getModuleId().getOrganisation();
    }

    public ModuleId getModuleId() {
        return moduleId;
    }

    public String getRevision() {
        return revision;
    }

    public DependencyScope getScope() {
        return scope;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Dependency that = (Dependency) o;

        if (!moduleId.equals(that.moduleId)) return false;
        if (!revision.equals(that.revision)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = moduleId.hashCode();
        result = 31 * result + revision.hashCode();
        return result;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.