1 19 20 package edu.umd.cs.findbugs; 21 22 27 public class BugCategory implements Comparable <BugCategory> { 28 final private String category; 29 final private String shortDescription; 30 private String abbrev; 31 private String detailText; 32 33 41 public BugCategory(String category, String shortDescription, String abbrev, String detailText) { 42 this.category = category; 43 this.shortDescription = shortDescription; 44 this.abbrev = abbrev; 45 this.detailText = detailText; 46 } 47 48 54 public BugCategory(String category, String shortDescription) { 55 this(category, shortDescription, null, null); 56 } 57 58 61 public String getCategory() { 62 return category; 63 } 64 65 68 public String getShortDescription() { 69 return shortDescription; 70 } 71 72 76 public String getAbbrev() { 77 return abbrev; 78 } 79 80 84 public String getDetailText() { 85 return detailText; 86 } 87 88 91 public void setAbbrev(String abbrev) { 92 this.abbrev = abbrev; 93 } 94 95 99 public void setDetailText(String detailText) { 100 this.detailText = detailText; 101 } 102 103 104 public int compareTo(BugCategory other) { 105 return category.compareTo(other.category); 106 } 107 108 @Override 109 public int hashCode() { 110 return category.hashCode(); 111 } 112 113 @Override 114 public boolean equals(Object o) { 115 if (!(o instanceof BugCategory)) return false; 116 BugCategory other = (BugCategory)o; 117 return category.equals(other.category); 118 } 119 120 121 @Override 122 public String toString() { 123 return "BugCategory["+category+"]{short="+shortDescription+",abbrev="+abbrev+",details="+detailText+'}'; 124 } 125 126 } 127 | Popular Tags |