1 18 19 package org.apache.beehive.netui.tools.testrecorder.shared.config; 20 21 import java.io.File ; 22 23 28 public class Category implements Comparable { 29 30 private String name; 31 private String description; 32 private File reportDir; 33 34 public Category( String name, String description, String baseDirPath ) throws ConfigException { 35 this.name = name; 36 this.description = description; 37 this.reportDir = new File ( baseDirPath + "/junit/" + name ); 38 } 39 40 public String getName() { 41 return name; 42 } 43 44 public String getDescription() { 45 return description; 46 } 47 48 public String getReportDirPath() { 49 return reportDir.getAbsolutePath(); 50 } 51 52 public int compareTo( Object o ) { 53 if ( o instanceof Category ) { 54 Category other = (Category) o; 55 return getName().compareToIgnoreCase( other.getName() ); 56 } 57 return 1; 58 } 59 60 public boolean equals( Object object ) { 61 if ( this == object ) { 62 return true; 63 } 64 else if ( object == null || getClass() != object.getClass() ) { 65 return false; 66 } 67 Category other = (Category) object; 68 return getName().equals( other.getName() ); 69 } 70 71 public int hashCode() { 72 return getName().hashCode(); 73 } 74 75 public String toString() { 76 StringBuffer sb = new StringBuffer ( 64 ); 77 sb.append( "[ " ); 78 sb.append( "name( " + name + " )" ); 79 sb.append( ", reportDir( " + getReportDirPath() + " )" ); 80 sb.append( ", description( " + description + " )" ); 81 sb.append( " ]" ); 82 return sb.toString(); 83 } 84 85 } 86 | Popular Tags |