View Javadoc

1   package org.lanyonm.playground.domain;
2   
3   import java.io.Serializable;
4   import java.util.Date;
5   
6   /**
7    * @author lanyonm
8    */
9   public class Todo implements Serializable {
10  
11  	private static final long serialVersionUID = 8865480730387267259L;
12  	private long id;
13  	private String title;
14  	private Date dateCreated;
15  	private Date dateModified;
16  	/**
17  	 * @return the id
18  	 */
19  	public long getId() {
20  		return id;
21  	}
22  	/**
23  	 * @param id the id to set
24  	 */
25  	public void setId(long id) {
26  		this.id = id;
27  	}
28  	/**
29  	 * @return the title
30  	 */
31  	public String getTitle() {
32  		return title;
33  	}
34  	/**
35  	 * @param title the title to set
36  	 */
37  	public void setTitle(String title) {
38  		this.title = title;
39  	}
40  	/**
41  	 * @return the dateCreated
42  	 */
43  	public Date getDateCreated() {
44  		return dateCreated;
45  	}
46  	/**
47  	 * @param dateCreated the dateCreated to set
48  	 */
49  	public void setDateCreated(Date dateCreated) {
50  		this.dateCreated = dateCreated;
51  	}
52  	/**
53  	 * @return the dateModified
54  	 */
55  	public Date getDateModified() {
56  		return dateModified;
57  	}
58  	/**
59  	 * @param dateModified the dateModified to set
60  	 */
61  	public void setDateModified(Date dateModified) {
62  		this.dateModified = dateModified;
63  	}
64  
65  	public boolean equals(Object obj) {
66  		if (obj == null) return false;
67  		if (obj == this) return true;
68  		return (obj instanceof Todo &&
69  				((Todo) obj).getId() == this.getId() &&
70  				(this.getTitle() == null ? ((Todo) obj).getTitle() == null : this.getTitle().equals(((Todo) obj).getTitle())) &&
71  				(this.getDateCreated() == null ? ((Todo) obj).getDateCreated() == null : this.getDateCreated().equals(((Todo) obj).getDateCreated())));
72  	}
73  
74  	public String toString() {
75  		return new StringBuilder("domain.Todo: title=\"").append(this.title)
76  				.append("\", dateCreated=\"").append(this.dateCreated)
77  				.append("\"").toString();
78  	}
79  }