Package org.localify.artist.join
Class ArtistCity
java.lang.Object
org.localify.artist.join.ArtistCity
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the composite key for the ArtistCity entity. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ArtistCity(Artist artist, City city, DataSource dataSource) Constructs a new ArtistCity with the given artist, city, and data source.ArtistCity(Artist artist, City city, User contributedBy) Constructs a new ArtistCity with the given artist, city, and contributing user. -
Method Summary
Modifier and TypeMethodDescriptionvoidban()Bans this artist-city relationship.Gets the artist.getCity()Gets the city.Gets the confirmation timestamp.Gets the user who contributed this relationship.Gets the creation timestamp.Gets the explanation for the artist-city relationship.booleanisBanned()Checks if this artist-city relationship is banned.booleanChecks if the relationship is confirmed.voidSets the artist.voidSets the city.voidsetConfirmedAt(Instant confirmedAt) Sets the confirmation timestamp.voidsetContributedBy(User contributedBy) Sets the user who contributed this relationship.voidsetExplanation(ArtistCityExplanation explanation) Sets the explanation for the artist-city relationship.toApproveableArtistCity(Integer contributionCountApproved, Integer contributionCountDenied) Converts this ArtistCity to anApproveableArtistCity.toCityArtistResponse(Boolean isFavorite) Converts this ArtistCity to aCity.CityArtistApiResponse.Converts this ArtistCity to anArtistCityResponse.voidunBan()Unbans this artist-city relationship.
-
Constructor Details
-
ArtistCity
public ArtistCity()Default constructor. -
ArtistCity
Constructs a new ArtistCity with the given artist, city, and data source.- Parameters:
artist- The artist.city- The city.dataSource- The data source.
-
ArtistCity
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
Converts this ArtistCity to anArtistCityResponse.- Returns:
- The response object.
-
toCityArtistResponse
Converts this ArtistCity to aCity.CityArtistApiResponse.- Parameters:
isFavorite- Whether the artist is a favorite of the current user.- Returns:
- The response object.
-
getArtist
Gets the artist.- Returns:
- The artist.
-
setArtist
Sets the artist.- Parameters:
artist- The artist.
-
getCity
Gets the city.- Returns:
- The city.
-
setCity
Sets the city.- Parameters:
city- The city.
-
getExplanation
Gets the explanation for the artist-city relationship.- Returns:
- The explanation.
-
setExplanation
Sets the explanation for the artist-city relationship.- Parameters:
explanation- The explanation.
-
getConfirmedAt
Gets the confirmation timestamp.- Returns:
- The confirmation timestamp.
-
setConfirmedAt
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
Gets the user who contributed this relationship.- Returns:
- The contributing user.
-
setContributedBy
Sets the user who contributed this relationship.- Parameters:
contributedBy- The contributing user.
-
getCreatedAt
Gets the creation timestamp.- Returns:
- The creation timestamp.
-
toApproveableArtistCity
public ApproveableArtistCity toApproveableArtistCity(Integer contributionCountApproved, Integer contributionCountDenied) Converts this ArtistCity to anApproveableArtistCity.- 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.
-