Class Post

java.lang.Object
org.example.model.Post

public class Post extends Object
Represents a social network post entity. Contains information about the author, content, likes, and timestamps.
  • Constructor Details

    • Post

      public Post()
      Default constructor for frameworks or manual initialization.
    • Post

      public Post(String author, String content)
      Constructor for creating a new post with minimal required data.
      Parameters:
      author - Nickname of the creator.
      content - Text content of the post.
  • Method Details

    • getId

      public int getId()
    • setId

      public void setId(int id)
    • getAuthor

      public String getAuthor()
    • setAuthor

      public void setAuthor(String author)
    • getContent

      public String getContent()
    • setContent

      public void setContent(String content)
    • getLikes

      public int getLikes()
    • setLikes

      public void setLikes(int likes)
    • isLikedByMe

      public boolean isLikedByMe()
    • setLikedByMe

      public void setLikedByMe(boolean likedByMe)
    • getCreatedAt

      public LocalDateTime getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(LocalDateTime createdAt)
    • getUpdatedAt

      public LocalDateTime getUpdatedAt()
    • setUpdatedAt

      public void setUpdatedAt(LocalDateTime updatedAt)
    • isEdited

      public boolean isEdited()
      Helper method to check if the post was edited.
      Returns:
      true if updated_at is different from created_at.