net.sf.taverna.raven.repository
Interface Artifact

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
ArtifactImpl, BasicArtifact

public interface Artifact
extends java.lang.Comparable

A single code artifact (jar) within a maven2 repository either remote or local. The status of the artifact is not held in this interface as it is only meaningful in relation to a Repository.

Normally you would subclass BasicArtifact instead of implementing this interface, as Artifact implementors also must be Comparable, implementing Comparable.compareTo(Object)compareTo and overriding Object.equals(Object) and Object.hashCode().

Author:
Tom Oinn, Stian Soiland-Reyes
See Also:
BasicArtifact

Method Summary
 boolean equals(java.lang.Object other)
          Compare with another object.
 java.lang.String getArtifactId()
          Get the artifact ID for this Artifact
 java.lang.String getGroupId()
          Get the group ID for this Artifact
 java.lang.String getVersion()
          Get the version for this Artifact, the version is not constrained to any particular format but is generally a period separated list of integers under lexicographical ordering.
 int hashCode()
          The hashCode should be calculated as the hash of the concatination of the artifactId, groupId and version, as in BasicArtifact.hashCode().
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

equals

boolean equals(java.lang.Object other)
Compare with another object. Two Artifact instanceses are considered equal if they are both Artifact instances, and their getArtifactId(), getGroupId() and getVersion() all equals.

Overrides:
equals in class java.lang.Object
Parameters:
other - Object to compare
Returns:
true if other is an Artifact and the artifactId, groupId and version equals

getArtifactId

java.lang.String getArtifactId()
Get the artifact ID for this Artifact

Returns:
The artifactId

getGroupId

java.lang.String getGroupId()
Get the group ID for this Artifact

Returns:
The groupId

getVersion

java.lang.String getVersion()
Get the version for this Artifact, the version is not constrained to any particular format but is generally a period separated list of integers under lexicographical ordering.

Returns:
The version

hashCode

int hashCode()
The hashCode should be calculated as the hash of the concatination of the artifactId, groupId and version, as in BasicArtifact.hashCode().

Overrides:
hashCode in class java.lang.Object
Returns:
Hash of the concatination of the artifactId, groupId and version