Package backend.Posts
Class Post
java.lang.Object
backend.Posts.Post
@Entity
public class Post
extends java.lang.Object
the backend's version of the post object.
- Author:
- asher
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
addComment(Comment post)
adds a comment to the post's list of comments.java.util.List<Comment>
getComments()
java.lang.String
getDate()
java.lang.String
getDescription()
int
getId()
java.lang.String
getImage()
int
getLikesCounter()
java.lang.String
getTitle()
User
getUser()
void
setComments(java.util.List<Comment> comments)
sets the list of comments on the post.void
setDate(java.lang.String date)
sets the date of the post.void
setDescription(java.lang.String description)
sets the description of the post.void
setId(int id)
sets the id of the post.void
setImage(java.lang.String image)
sets the image of the post.void
setLikesCounter(int likesCounter)
sets the number of likes the post has.void
setTitle(java.lang.String title)
sets the title of the post.void
setUser(User user)
sets the user who created the post.
-
Constructor Details
-
Method Details
-
getId
public int getId()- Returns:
- the post's id.
-
setId
public void setId(int id)sets the id of the post.- Parameters:
id
-
-
getImage
public java.lang.String getImage()- Returns:
- the post's image.
-
setImage
public void setImage(java.lang.String image)sets the image of the post.- Parameters:
image
-
-
getTitle
public java.lang.String getTitle()- Returns:
- the post's title.
-
setTitle
public void setTitle(java.lang.String title)sets the title of the post.- Parameters:
title
-
-
getDescription
public java.lang.String getDescription()- Returns:
- the post's description.
-
setDescription
public void setDescription(java.lang.String description)sets the description of the post.- Parameters:
description
-
-
getDate
public java.lang.String getDate()- Returns:
- the date the post was created.
-
setDate
public void setDate(java.lang.String date)sets the date of the post.- Parameters:
date
-
-
getUser
- Returns:
- the user who created the post.
-
setUser
sets the user who created the post.- Parameters:
user
-
-
getLikesCounter
public int getLikesCounter()- Returns:
- the number of likes the post has.
-
setLikesCounter
public void setLikesCounter(int likesCounter)sets the number of likes the post has.- Parameters:
likesCounter
-
-
getComments
- Returns:
- the list of comments on the post.
-
setComments
sets the list of comments on the post.- Parameters:
comments
-
-
addComment
adds a comment to the post's list of comments.- Parameters:
post
-
-