/* * Bookmark.java * * Created on: 08-Feb-2010 * */ package netukar.tinybrowser.bookmarks; /** * * @author radovan */ public class Bookmark { private String title; private String uri; /** * Creates a new instance of Bookmark. */ public Bookmark() { } public Bookmark(String title, String uri) { this.title = title; this.uri = uri; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getURI() { return uri; } public void setURI(String uri) { if (uri == null) { throw new IllegalArgumentException("Bookmark URI cannot be null."); } this.uri = uri; } @Override public boolean equals(Object object) { if (object instanceof Bookmark) { Bookmark other = (Bookmark) object; return ((((title == null) && (other.title == null)) || title.equals(other.title)) && uri.equals(other.uri)); } else { return false; } } @Override public int hashCode() { int hash = 7; hash = 97 * hash + (this.title != null ? this.title.hashCode() : 0); hash = 97 * hash + (this.uri != null ? this.uri.hashCode() : 0); return hash; } }