1 6 package fr.jayasoft.ivy; 7 8 import java.util.Map ; 9 10 14 public abstract class AbstractArtifact implements Artifact { 15 public AbstractArtifact() { 16 } 17 18 public boolean equals(Object obj) { 19 if (!(obj instanceof Artifact)) { 20 return false; 21 } 22 Artifact art = (Artifact)obj; 23 return getModuleRevisionId().equals(art.getModuleRevisionId()) 24 && getPublicationDate()==null?true:getPublicationDate().equals(art.getPublicationDate()) 25 && getName().equals(art.getName()) 26 && getExt().equals(art.getExt()) 27 && getType().equals(art.getType()) 28 && getExtraAttributes().equals(art.getExtraAttributes()); 29 } 30 31 public int hashCode() { 32 int hash = 33; 33 hash = hash * 17 + getModuleRevisionId().hashCode(); 34 if (getPublicationDate() != null) { 35 hash = hash * 17 + getPublicationDate().hashCode(); 36 } 37 hash = hash * 17 + getName().hashCode(); 38 hash = hash * 17 + getExt().hashCode(); 39 hash = hash * 17 + getType().hashCode(); 40 hash = hash * 17 + getExtraAttributes().hashCode(); 41 return hash; 42 } 43 44 public String toString() { 45 return getModuleRevisionId()+"/"+getName()+"."+getExt()+"["+getType()+"]"; 46 } 47 48 public String getAttribute(String attName) { 49 return getId().getAttribute(attName); 50 } 51 52 public Map getAttributes() { 53 return getId().getAttributes(); 54 } 55 56 public String getExtraAttribute(String attName) { 57 return getId().getExtraAttribute(attName); 58 } 59 60 public Map getExtraAttributes() { 61 return getId().getExtraAttributes(); 62 } 63 64 public String getStandardAttribute(String attName) { 65 return getId().getStandardAttribute(attName); 66 } 67 68 public Map getStandardAttributes() { 69 return getId().getStandardAttributes(); 70 } 71 72 73 } 74 | Popular Tags |