Class Genre

java.lang.Object
org.localify.music.genre.Genre

@Entity public class Genre extends Object
Represents a music genre.
  • Constructor Details

    • Genre

      protected Genre()
      Protected no-arg constructor for JPA.
    • Genre

      public Genre(String name)
      Constructs a new Genre.
      Parameters:
      name - The name of the genre.
  • Method Details

    • getId

      public UUID getId()
      Gets the ID of the genre.
      Returns:
      The genre ID.
    • getName

      public String getName()
      Gets the name of the genre.
      Returns:
      The genre name.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp.
      Returns:
      The creation timestamp.
    • getBannedAt

      public Instant getBannedAt()
      Gets the banned timestamp.
      Returns:
      The banned timestamp.
    • setBanned

      public void setBanned()
      Sets the banned timestamp to now.
    • toResponse

      public GenreResponse toResponse()
      Converts the genre to a response DTO.
      Returns:
      The genre response DTO.
    • setId

      public void setId(UUID id)
      Sets the ID of the genre.
      Parameters:
      id - The genre ID.
    • setName

      public void setName(String name)
      Sets the name of the genre.
      Parameters:
      name - The genre name.
    • setCreatedAt

      public void setCreatedAt(Instant createdAt)
      Sets the creation timestamp.
      Parameters:
      createdAt - The creation timestamp.
    • setBannedAt

      public void setBannedAt(Instant bannedAt)
      Sets the banned timestamp.
      Parameters:
      bannedAt - The banned timestamp.
    • getArtists

      public Set<Artist> getArtists()
      Gets the artists associated with the genre.
      Returns:
      A set of artists.
    • setArtists

      public void setArtists(Set<Artist> artists)
      Sets the artists associated with the genre.
      Parameters:
      artists - A set of artists.
    • getCreatedByDataSource

      public DataSource getCreatedByDataSource()
      Gets the data source that created the genre.
      Returns:
      The data source.
    • setCreatedByDataSource

      public void setCreatedByDataSource(DataSource createdByDataSource)
      Sets the data source that created the genre.
      Parameters:
      createdByDataSource - The data source.
    • getNameReadable

      public String getNameReadable()
      Gets the readable name of the genre.
      Returns:
      The readable name.
    • setNameReadable

      public void setNameReadable(String nameReadable)
      Sets the readable name of the genre.
      Parameters:
      nameReadable - The readable name.
    • toString

      public String toString()
      Overrides:
      toString in class Object