Class Article
java.lang.Object
com.endurancetrio.data.common.model.entity.AuditableEntity
com.endurancetrio.data.common.model.entity.BaseEntity<Long>
com.endurancetrio.data.insight.model.entity.Article
- All Implemented Interfaces:
Serializable
The
Article entity represents an insight article in the Insights section.
The Article's fields are defined as follows:
-
id: the unique identifier of theArticlethat is automatically generated and is the primary key. -
slug: the unique URL slug of theArticle. -
author: theAuthorof theArticle. -
publishedDate: the date when theArticlewas published. -
featuredImage: the optional URL of the featured image for theArticle. -
featuredImageWidth: the optional width of the featured image in pixels. -
featuredImageHeight: the optional height of the featured image in pixels. -
contents: the localized content entries for theArticle. -
relatedEvents: the optional set ofeventsrelated to theArticle.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContent(ArticleContent content) Adds anArticleContentto theArticle.booleanEquality is based on the entity's identifier.getSlug()inthashCode()voidremoveContent(ArticleContent content) Removes anArticleContentfrom theArticle.voidvoidsetContents(Set<ArticleContent> contents) voidsetFeaturedImage(String featuredImage) voidsetFeaturedImageHeight(Integer featuredImageHeight) voidsetFeaturedImageWidth(Integer featuredImageWidth) voidsetPublishedDate(LocalDateTime publishedDate) voidsetRelatedEvents(Set<Event> relatedEvents) voidtoString()Methods inherited from class com.endurancetrio.data.common.model.entity.BaseEntity
getId, setIdMethods inherited from class com.endurancetrio.data.common.model.entity.AuditableEntity
getCreatedAt, getUpdatedAt, getVersion
-
Constructor Details
-
Article
public Article()Default constructor for theArticleentity.
-
-
Method Details
-
addContent
Adds anArticleContentto theArticle. This method also sets theArticlereference in theArticleContent.- Parameters:
content- theArticleContentto be added
-
removeContent
Removes anArticleContentfrom theArticle. This method also removes theArticlereference from theArticleContent.- Parameters:
content- theArticleContentto be removed
-
getSlug
-
setSlug
-
getAuthor
-
setAuthor
-
getPublishedDate
-
setPublishedDate
-
getFeaturedImage
-
setFeaturedImage
-
getFeaturedImageWidth
-
setFeaturedImageWidth
-
getFeaturedImageHeight
-
setFeaturedImageHeight
-
getContents
-
setContents
-
getRelatedEvents
-
setRelatedEvents
-
equals
Description copied from class:BaseEntityEquality is based on the entity's identifier. Two entities are considered equal if they are of the same class and have the same non-null identifier.If the ID is null, we treat it as a transient (new) object. Transient objects are only equal if they are the exact same instance.
- Overrides:
equalsin classBaseEntity<Long>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEntity<Long>
-
toString
-