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

    Constructors 
    Constructor Description
    Post()  
    Post​(java.lang.String title, java.lang.String description, java.lang.String date, User user)  
  • 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Post

      public Post()
    • Post

      public Post​(java.lang.String title, java.lang.String description, java.lang.String date, User user)
      Parameters:
      title - title of the post
      description - the main body of the post
      date - the date of the post in the format "MM/DD/YYYY"
      user - the user who created the post
  • 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

      public User getUser()
      Returns:
      the user who created the post.
    • setUser

      public void setUser​(User user)
      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

      public java.util.List<Comment> getComments()
      Returns:
      the list of comments on the post.
    • setComments

      public void setComments​(java.util.List<Comment> comments)
      sets the list of comments on the post.
      Parameters:
      comments -
    • addComment

      public void addComment​(Comment post)
      adds a comment to the post's list of comments.
      Parameters:
      post -