Index: /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ArtifactId.java =================================================================== --- /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ArtifactId.java (revision 551245) +++ /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ArtifactId.java (working copy) @@ -30,9 +30,9 @@ private String ext; /** - * @param mid - * @param name - * @param type + * @param mid The ModuleId, which is the base of this artifact. + * @param name The name of the artifact. + * @param type The type of the artifact. */ public ArtifactId(ModuleId mid, String name, String type, String ext) { this.mid = mid; @@ -41,6 +41,7 @@ this.ext = ext; } + /** {@inheritDoc} */ public boolean equals(Object obj) { if (!(obj instanceof ArtifactId)) { return false; @@ -50,6 +51,7 @@ && getExt().equals(aid.getExt()) && getType().equals(aid.getType()); } + /** {@inheritDoc} */ public int hashCode() { //CheckStyle:MagicNumber| OFF int hash = 17; @@ -60,6 +62,7 @@ return hash; } + /** {@inheritDoc} */ public String toString() { return getModuleId() + " " + getName() + "." + getType(); } Index: /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ModuleId.java =================================================================== --- /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ModuleId.java (revision 551245) +++ /home/tverhagen/dev_ext/ivy/src/java/org/apache/ivy/core/module/id/ModuleId.java (working copy) @@ -29,6 +29,11 @@ private int hash; + /** + * Constructor. + * @param organisation The organisation which creates the module. + * @param name The name of the module. + */ public ModuleId(String organisation, String name) { if (name == null) { throw new IllegalArgumentException("null name not allowed"); @@ -37,6 +42,10 @@ this.name = name; } + /** + * Returns the name of the module. + * @return The name of the module. + */ public String getName() { return name; } @@ -41,6 +50,10 @@ return name; } + /** + * Returns the name of the organisation. + * @return The name of the organisation. + */ public String getOrganisation() { return organisation; } @@ -45,6 +58,7 @@ return organisation; } + /** {@inheritDoc} */ public boolean equals(Object obj) { if (!(obj instanceof ModuleId)) { return false; @@ -57,6 +71,7 @@ } } + /** {@inheritDoc} */ public int hashCode() { if (hash == 0) { //CheckStyle:MagicNumber| OFF @@ -68,7 +83,7 @@ return hash; } - + /** {@inheritDoc} */ public String toString() { return "[ " + organisation + " | " + name + " ]"; } @@ -73,6 +88,7 @@ return "[ " + organisation + " | " + name + " ]"; } + /** {@inheritDoc} */ public int compareTo(Object obj) { ModuleId that = (ModuleId) obj; int result = organisation.compareTo(that.organisation); @@ -82,6 +98,10 @@ return result; } + /** + * Returns the encoded String representing this ModuleId. + * @return The ModuleId encoded as String. + */ public String encodeToString() { return getOrganisation() + ENCODE_SEPARATOR + getName(); } @@ -86,6 +106,12 @@ return getOrganisation() + ENCODE_SEPARATOR + getName(); } + /** + * Returns a ModuleId + * @param encoded + * @return The new ModuleId. + * @throws IllegalArgumentException If the given String could not be decoded. + */ public static ModuleId decode(String encoded) { String[] parts = encoded.split(ENCODE_SEPARATOR); if (parts.length != 2) {