public class Post extends Object implements Comparable<Post>
| Constructor and Description |
|---|
Post()
Default constructor.
|
Post(long postId,
String userId,
Date creationDate,
String content)
Full constructor.
|
Post(String userId,
String content)
Constructor used for creating a new post; sets post id to null and creation date to current date.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Post post) |
String |
getContent()
Get the content.
|
Date |
getCreationDate()
Get the creation date.
|
long |
getPostId()
Get the post id.
|
String |
getUserId()
Get the user id.
|
void |
setContent(String content)
Set the content.
|
void |
setCreationDate(Date creationDate)
Set the creation date.
|
void |
setPostId(long postId)
Set the post id.
|
void |
setUserId(String userId)
Set the user id.
|
public Post()
public Post(long postId,
String userId,
Date creationDate,
String content)
postId - the id of this postuserId - the id of the user that created this postcreationDate - the date that this post was createdcontent - the content of this postpublic long getPostId()
public void setPostId(long postId)
postId - the new id of this postpublic String getUserId()
public void setUserId(String userId)
userId - the id of the new user that created this postpublic Date getCreationDate()
public void setCreationDate(Date creationDate)
creationDate - the new date that this post was createdpublic String getContent()
public void setContent(String content)
content - the new content of this postpublic int compareTo(Post post)
compareTo in interface Comparable<Post>Copyright © 2017. All rights reserved.