Package org.localify.music.genre
Class Genre
java.lang.Object
org.localify.music.genre.Genre
Represents a music genre.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the artists associated with the genre.Gets the banned timestamp.Gets the creation timestamp.Gets the data source that created the genre.getId()Gets the ID of the genre.getName()Gets the name of the genre.Gets the readable name of the genre.voidsetArtists(Set<Artist> artists) Sets the artists associated with the genre.voidSets the banned timestamp to now.voidsetBannedAt(Instant bannedAt) Sets the banned timestamp.voidsetCreatedAt(Instant createdAt) Sets the creation timestamp.voidsetCreatedByDataSource(DataSource createdByDataSource) Sets the data source that created the genre.voidSets the ID of the genre.voidSets the name of the genre.voidsetNameReadable(String nameReadable) Sets the readable name of the genre.Converts the genre to a response DTO.toString()
-
Constructor Details
-
Genre
protected Genre()Protected no-arg constructor for JPA. -
Genre
Constructs a new Genre.- Parameters:
name- The name of the genre.
-
-
Method Details
-
getId
Gets the ID of the genre.- Returns:
- The genre ID.
-
getName
Gets the name of the genre.- Returns:
- The genre name.
-
getCreatedAt
Gets the creation timestamp.- Returns:
- The creation timestamp.
-
getBannedAt
Gets the banned timestamp.- Returns:
- The banned timestamp.
-
setBanned
public void setBanned()Sets the banned timestamp to now. -
toResponse
Converts the genre to a response DTO.- Returns:
- The genre response DTO.
-
setId
Sets the ID of the genre.- Parameters:
id- The genre ID.
-
setName
Sets the name of the genre.- Parameters:
name- The genre name.
-
setCreatedAt
Sets the creation timestamp.- Parameters:
createdAt- The creation timestamp.
-
setBannedAt
Sets the banned timestamp.- Parameters:
bannedAt- The banned timestamp.
-
getArtists
Gets the artists associated with the genre.- Returns:
- A set of artists.
-
setArtists
Sets the artists associated with the genre.- Parameters:
artists- A set of artists.
-
getCreatedByDataSource
Gets the data source that created the genre.- Returns:
- The data source.
-
setCreatedByDataSource
Sets the data source that created the genre.- Parameters:
createdByDataSource- The data source.
-
getNameReadable
Gets the readable name of the genre.- Returns:
- The readable name.
-
setNameReadable
Sets the readable name of the genre.- Parameters:
nameReadable- The readable name.
-
toString
-