001package org.lanyonm.playground.domain; 002 003import java.io.Serializable; 004import java.util.Date; 005 006/** 007 * @author lanyonm 008 */ 009public class Todo implements Serializable { 010 011 private static final long serialVersionUID = 8865480730387267259L; 012 private long id; 013 private String title; 014 private Date dateCreated; 015 private Date dateModified; 016 /** 017 * @return the id 018 */ 019 public long getId() { 020 return id; 021 } 022 /** 023 * @param id the id to set 024 */ 025 public void setId(long id) { 026 this.id = id; 027 } 028 /** 029 * @return the title 030 */ 031 public String getTitle() { 032 return title; 033 } 034 /** 035 * @param title the title to set 036 */ 037 public void setTitle(String title) { 038 this.title = title; 039 } 040 /** 041 * @return the dateCreated 042 */ 043 public Date getDateCreated() { 044 return dateCreated; 045 } 046 /** 047 * @param dateCreated the dateCreated to set 048 */ 049 public void setDateCreated(Date dateCreated) { 050 this.dateCreated = dateCreated; 051 } 052 /** 053 * @return the dateModified 054 */ 055 public Date getDateModified() { 056 return dateModified; 057 } 058 /** 059 * @param dateModified the dateModified to set 060 */ 061 public void setDateModified(Date dateModified) { 062 this.dateModified = dateModified; 063 } 064 065 public boolean equals(Object obj) { 066 if (obj == null) return false; 067 if (obj == this) return true; 068 return (obj instanceof Todo && 069 ((Todo) obj).getId() == this.getId() && 070 (this.getTitle() == null ? ((Todo) obj).getTitle() == null : this.getTitle().equals(((Todo) obj).getTitle())) && 071 (this.getDateCreated() == null ? ((Todo) obj).getDateCreated() == null : this.getDateCreated().equals(((Todo) obj).getDateCreated()))); 072 } 073 074 public String toString() { 075 return new StringBuilder("domain.Todo: title=\"").append(this.title) 076 .append("\", dateCreated=\"").append(this.dateCreated) 077 .append("\"").toString(); 078 } 079}