Back to project page TrackEveryPenny.
The source code is released under:
Apache License
If you think the Android project TrackEveryPenny listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.jbrains.upfp.model; // www.ja v a 2s .c o m import ca.jbrains.toolkit.ProgrammerMistake; public final class Category { private final String name; public Category(String name) { if (name == null) throw new IllegalArgumentException( "name can't be null"); if (name.isEmpty()) throw new ProgrammerMistake( "Category name can't be blank."); if (name.trim().isEmpty()) throw new ProgrammerMistake( "Category name can't be only whitespace."); this.name = name; } public String getName() { return name; } @Override public boolean equals(Object other) { if (other instanceof Category) { final Category that = (Category) other; return this.name.equals(that.name); } return false; } @Override public int hashCode() { return name.hashCode(); } @Override public String toString() { return name; } }