Back to project page watchme.
The source code is released under:
Copyright (c) 2012 Johan Brook, Robin Andersson, Lisa Stenberg, Mattias Henriksson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen...
If you think the Android project watchme listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * Tag.java/* ww w. j a v a2s . c om*/ * * A class that represents a Tag. * * @author lisastenberg * @author mattiashenriksson * @copyright (c) 2012 Johan Brook, Robin Andersson, Lisa Stenberg, Mattias Henriksson * @license MIT */ package se.chalmers.watchme.model; import java.io.Serializable; public class Tag implements Serializable { private String name; private String slug; private long id; /** * Creates a Tag and generates a slug after the given name. * * @param name * The name of the Tag. */ public Tag(String name) { this.name = name; this.slug = generateSlug(name); } /** * @return the id of the Tag. */ public long getId() { return this.id; } /** * Sets the id. * * @param id * the id you want to set. */ public void setId(long id) { this.id = id; } /** * @return The name of the Tag. */ public String getName() { return this.name; } /** * @return The slug. */ public String getSlug() { return this.slug; } /** * Generates a slug of a given string. * * @param s * The string. * @return The slug. */ public static String generateSlug(String s) { return s.toLowerCase(); } @Override public String toString() { return this.name; } @Override public boolean equals(Object o) { if (this == o) { return true; } else if (o == null || this.getClass() != o.getClass()) { return false; } else { Tag tmp = (Tag) o; return this.getSlug().equals(tmp.getSlug()); } } @Override public int hashCode() { return this.slug.hashCode(); } }