@Entity public class Story extends Object implements Serializable
| Constructor and Description |
|---|
Story() |
Story(Date date,
String title,
String content,
Genre genre,
Theme mainTheme,
Theme secondaryTheme,
User author,
boolean published) |
Story(int id,
Date date,
String title,
String content,
Genre genre,
Theme mainTheme,
Theme secondaryTheme,
User author,
boolean published) |
| Modifier and Type | Method and Description |
|---|---|
void |
addVisit(Date date) |
User |
getAuthor() |
String |
getContent() |
Date |
getDate() |
Genre |
getGenre() |
int |
getId() |
Theme |
getMainTheme() |
Theme |
getSecondaryTheme() |
String |
getTitle() |
long |
getVisitCountInDateRange(Date startDate,
Date endDate)
Get the number of visits in the range between startDate and endDate.
|
List<Date> |
getVisitDate() |
boolean |
isPublished() |
void |
setAuthor(User author) |
void |
setVisitDate(List<Date> visitDate)
Sets the list of visit date.
|
String |
toString() |
public Story()
public Story(int id,
Date date,
String title,
String content,
Genre genre,
Theme mainTheme,
Theme secondaryTheme,
User author,
boolean published)
throws IllegalArgumentException
IllegalArgumentExceptionpublic Story(Date date, String title, String content, Genre genre, Theme mainTheme, Theme secondaryTheme, User author, boolean published) throws IllegalArgumentException
IllegalArgumentExceptionpublic int getId()
public Date getDate()
public String getTitle()
public String getContent()
public Genre getGenre()
public Theme getMainTheme()
public Theme getSecondaryTheme()
public User getAuthor()
public boolean isPublished()
public void setVisitDate(List<Date> visitDate)
visitDate - The new list of visit date.public long getVisitCountInDateRange(Date startDate, Date endDate)
startDate - The start date.endDate - The end date.public void addVisit(Date date)
public void setAuthor(User author)
Copyright © 2022. All rights reserved.