package it.demo.twitterlike.rest.api; import java.io.Serializable; import java.util.Date; public class Message implements Serializable { /** * */ private static final long serialVersionUID = 1L; private Long id; private String text; private String author; private Date createdDate; private Date lastModifiedDate; public Message(String text) { this.text = text; } public Message() { } public String getAuthor() { return author; } public Date getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Date lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public Date getCreatedDate() { return createdDate; } public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Message other = (Message) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } public void setAuthor(String author) { this.author = author; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } }