package src.hibernatebb.discussion;

import src.hibernatebb.discussion.User;
import java.util.Date;

/**
 * A post in the bulletin board. <code>Post</code>'s belong to <code>Topic</code>'s and
 * have a <code>User</code>, specifcally poster.  A <code>Post</code> is comprised of a 
 * Subject and Body.
 * 
 * The design of this class was heavily based on the example code in Better, Faster, Lighter Java
 *  by authors Bruce Tate and Justin Gehtland.
 * 
 * @author Peter Deschere
 * @version 1.0
 * @see <a>http://www.hibernate.org</a>
 * @see src.hibernatebb.discussion.User
 * @see src.hibernatebb.discussion.Topic
 */
public class Post {

	Long id = null;
	String subject = "No Subject";
	String body = "Empty post";
	User poster = null;
	Date timestamp = new Date();
	
	public Post(User u, String s, String b) {
		poster = u;
		subject = s;
		body = b;
	}
	
	public Post() {}
	
	public Long getID(){
		return id;
	}
	
	private void setID(Long newPost) {
		id = newPost;
	}
	
	public String getSubject(){
		return subject;
	}
	
	public void setSubject(String s) {
		subject = s;
	}
	
	public String getBody() {
		return body;
	}
	
	public void setBody(String b) {
		body = b;
	}
	
	public User getPoster() {
		return poster;
	}
	
	public void setPoster(User p) {
		poster = p;
	}
	
	public Date getTimestamp() {
		return timestamp;
	}
	
	public void setTimestamp(Date ts) {
		timestamp = ts;
	}
}
