Class ArtistCity

java.lang.Object
org.localify.artist.join.ArtistCity

@Entity public class ArtistCity extends Object
Represents the join table between artists and cities. This entity stores the relationship between an artist and a city, including the data source, explanation, and contribution details.
  • Constructor Details

    • ArtistCity

      public ArtistCity()
      Default constructor.
    • ArtistCity

      public ArtistCity(Artist artist, City city, DataSource dataSource)
      Constructs a new ArtistCity with the given artist, city, and data source.
      Parameters:
      artist - The artist.
      city - The city.
      dataSource - The data source.
    • ArtistCity

      public ArtistCity(Artist artist, City city, User contributedBy)
      Constructs a new ArtistCity with the given artist, city, and contributing user.
      Parameters:
      artist - The artist.
      city - The city.
      contributedBy - The user who contributed this relationship.
  • Method Details

    • toResponse

      public ArtistCityResponse toResponse()
      Converts this ArtistCity to an ArtistCityResponse.
      Returns:
      The response object.
    • toCityArtistResponse

      public City.CityArtistApiResponse toCityArtistResponse(Boolean isFavorite)
      Converts this ArtistCity to a City.CityArtistApiResponse.
      Parameters:
      isFavorite - Whether the artist is a favorite of the current user.
      Returns:
      The response object.
    • getArtist

      public Artist getArtist()
      Gets the artist.
      Returns:
      The artist.
    • setArtist

      public void setArtist(Artist artist)
      Sets the artist.
      Parameters:
      artist - The artist.
    • getCity

      public City getCity()
      Gets the city.
      Returns:
      The city.
    • setCity

      public void setCity(City city)
      Sets the city.
      Parameters:
      city - The city.
    • getExplanation

      public ArtistCityExplanation getExplanation()
      Gets the explanation for the artist-city relationship.
      Returns:
      The explanation.
    • setExplanation

      public void setExplanation(ArtistCityExplanation explanation)
      Sets the explanation for the artist-city relationship.
      Parameters:
      explanation - The explanation.
    • getConfirmedAt

      public Instant getConfirmedAt()
      Gets the confirmation timestamp.
      Returns:
      The confirmation timestamp.
    • setConfirmedAt

      public void setConfirmedAt(Instant confirmedAt)
      Sets the confirmation timestamp.
      Parameters:
      confirmedAt - The confirmation timestamp.
    • isConfirmed

      public boolean isConfirmed()
      Checks if the relationship is confirmed.
      Returns:
      True if confirmed, false otherwise.
    • getContributedBy

      public User getContributedBy()
      Gets the user who contributed this relationship.
      Returns:
      The contributing user.
    • setContributedBy

      public void setContributedBy(User contributedBy)
      Sets the user who contributed this relationship.
      Parameters:
      contributedBy - The contributing user.
    • getCreatedAt

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

      public ApproveableArtistCity toApproveableArtistCity(Integer contributionCountApproved, Integer contributionCountDenied)
      Converts this ArtistCity to an ApproveableArtistCity.
      Parameters:
      contributionCountApproved - The number of approved contributions by the user.
      contributionCountDenied - The number of denied contributions by the user.
      Returns:
      The approveable artist city object.
    • ban

      public void ban()
      Bans this artist-city relationship.
    • unBan

      public void unBan()
      Unbans this artist-city relationship.
    • isBanned

      public boolean isBanned()
      Checks if this artist-city relationship is banned.
      Returns:
      True if banned, false otherwise.