1 19 20 package org.netbeans.modules.apisupport.project.universe; 21 22 import java.util.Comparator ; 23 24 30 public class TestModuleDependency implements Comparable { 31 32 public static final String UNIT = "unit"; public static final String QA_FUNCTIONAL = "qa-functional"; 35 private final ModuleEntry module; 36 private boolean test; 38 private boolean recursive; 40 private boolean compile; 42 43 public static final Comparator CNB_COMPARATOR = new Comparator () { 44 public int compare(Object tmd1,Object tmd2) { 45 return ((TestModuleDependency)tmd1).module.getCodeNameBase().compareTo(((TestModuleDependency)tmd2).module.getCodeNameBase()); 46 } 47 }; 48 49 52 public TestModuleDependency(ModuleEntry me,boolean test,boolean recursive,boolean compile) { 53 this.module = me; 54 this.test = test; 55 this.recursive = recursive; 56 this.compile = compile; 57 } 58 59 public ModuleEntry getModule() { 60 return module; 61 } 62 63 public boolean isTest() { 64 return test; 65 } 66 67 public void setTest(boolean test) { 68 this.test = test; 69 } 70 71 public boolean isRecursive() { 72 return recursive; 73 } 74 75 public void setRecursive(boolean recursive) { 76 this.recursive = recursive; 77 } 78 79 public boolean isCompile() { 80 return compile; 81 } 82 83 public void setCompile(boolean compile) { 84 this.compile = compile; 85 } 86 87 public boolean equals(Object o){ 89 if(o instanceof TestModuleDependency) { 90 TestModuleDependency tmd = (TestModuleDependency) o; 91 return tmd.isCompile() == this.isCompile() 92 && tmd.isRecursive() == this.isRecursive() 93 && tmd.isTest() == this.isTest() 94 && tmd.getModule().getCodeNameBase().equals(this.getModule().getCodeNameBase()); 95 } else { 96 return false; 97 } 98 } 99 100 public int compareTo(Object o) { 104 TestModuleDependency tmd = (TestModuleDependency) o; 105 return this.module.getCodeNameBase().compareTo(tmd.module.getCodeNameBase()); 106 } 107 108 public int hashCode(){ 110 int hash = module.getCodeNameBase().hashCode(); 111 return hash; 115 } 116 } 117 | Popular Tags |