| 1 6 package fr.jayasoft.ivy; 7 8 11 public class ArtifactId { 12 private ModuleId _mid; 13 private String _name; 14 private String _type; 15 private String _ext; 16 17 18 23 public ArtifactId(ModuleId mid, String name, String type, String ext) { 24 _mid = mid; 25 _name = name; 26 _type = type; 27 _ext = ext; 28 } 29 30 public boolean equals(Object obj) { 31 if (! (obj instanceof ArtifactId)) { 32 return false; 33 } 34 ArtifactId aid = (ArtifactId)obj; 35 return getModuleId().equals(aid.getModuleId()) 36 && getName().equals(aid.getName()) 37 && getExt().equals(aid.getExt()) 38 && getType().equals(aid.getType()); 39 } 40 41 public int hashCode() { 42 int hash = 17; 43 hash += getModuleId().hashCode() * 37; 44 hash += getName().hashCode() * 37; 45 hash += getType().hashCode() * 37; 46 return hash; 47 } 48 49 public String toString() { 50 return getModuleId()+" "+getName()+"."+getType(); 51 } 52 53 56 public ModuleId getModuleId() { 57 return _mid; 58 } 59 62 public String getName() { 63 return _name; 64 } 65 68 public String getType() { 69 return _type; 70 } 71 74 public String getExt() { 75 return _ext; 76 } 77 } 78 | Popular Tags |