Package model.entity
Class Post
- java.lang.Object
-
- model.entity.Post
-
- All Implemented Interfaces:
Serializable
@Entity public class Post extends Object implements Serializable
Entità rappresentante un post- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPost.Type
-
Field Summary
Fields Modifier and Type Field Description protected Userauthorprotected List<Comment>commentsprotected Stringcontentprotected InstantcreationDateprotected Integeridprotected Sectionsectionprotected Stringtitleprotected Post.Typetypeprotected Map<User,PostVote>votesprotected IntegervotesCount
-
Constructor Summary
Constructors Constructor Description Post()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetCommentCount()PostVotegetVote(User user)Ottieni il voto di un utente al post in questione (ointhashCode()
-
-
-
Field Detail
-
creationDate
protected Instant creationDate
-
votesCount
protected Integer votesCount
-
-
Constructor Detail
-
Post
public Post()
-
-
Method Detail
-
getCommentCount
public int getCommentCount()
-
getVote
public PostVote getVote(User user)
Ottieni il voto di un utente al post in questione (onull
se il voto non è presente)- Parameters:
user- Riferimento all'utente- Returns:
- Un oggetto
PostVote
-
-