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 voidaddComment(Comment post)adds a comment to the post's list of comments.java.util.List<Comment>getComments()java.lang.StringgetDate()java.lang.StringgetDescription()intgetId()java.lang.StringgetImage()intgetLikesCounter()java.lang.StringgetTitle()UsergetUser()voidsetComments(java.util.List<Comment> comments)sets the list of comments on the post.voidsetDate(java.lang.String date)sets the date of the post.voidsetDescription(java.lang.String description)sets the description of the post.voidsetId(int id)sets the id of the post.voidsetImage(java.lang.String image)sets the image of the post.voidsetLikesCounter(int likesCounter)sets the number of likes the post has.voidsetTitle(java.lang.String title)sets the title of the post.voidsetUser(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-
-