Android Open Source - TrackEveryPenny Category

From Project

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.

Java Source Code

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."); = name;

  public String getName() {
    return name;

  public boolean equals(Object other) {
    if (other instanceof Category) {
      final Category that = (Category) other;
    return false;

  public int hashCode() {
    return name.hashCode();

  public String toString() {
    return name;

Java Source Code List