code_junkie

How far do you take code coverage?

Nov 12th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //this class is meant as a pseudo-enum - I'm stuck on Java 1.4 for time being
  2. public final class BillingUnit {
  3.  
  4. public final static BillingUnit MONTH = new BillingUnit("month");
  5. public final static BillingUnit YEAR = new BillingUnit("year");
  6.  
  7. private String value;
  8.  
  9. private BillingUnit(String value) {
  10. this.value = value;
  11. }
  12.  
  13. public String getValue() {
  14. return this.value;
  15. }
  16.  
  17. public boolean equals(Object obj) {
  18. return value.equals(((BillingUnit) obj).getValue());
  19.  
  20. }
  21.  
  22. public int hashCode() {
  23. return value.hashCode();
  24. }
  25. }
  26.  
  27. if(logger.isDebugEnabled()) {
  28. logger.debug("something");
  29. }
  30.  
  31. public float reciprocal (float ex)
  32. {
  33. return (1.0 / ex) ;
  34. }
Add Comment
Please, Sign In to add comment