Package org.localify.city
Class City
java.lang.Object
org.localify.city.City
Represents a city.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents an artist in a city for API responses. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the banned timestamp of the city.Gets the country code of the city.Gets the country name of the city.Gets the creation timestamp of the city.Gets the eastern boundary of the city's region.Gets a friendly name for the city (e.g., "Ithaca, NY").org.locationtech.jts.geom.PointGets the geographical point of the city.Gets the timestamp when the city was last queued for a Google update.Gets the timestamp when the city's Google data was last updated.getId()Gets the ID of the city.getImage()Gets the URL of an image of the city.Gets the latitude of the city.Gets the longitude of the city.getName()Gets the name of the city.Gets the northern boundary of the city's region.Gets the playlist associated with the city.Gets the Pollstar ID of the city.Gets the timestamp when the city was last queued for a Pollstar update.Gets the timestamp when the city's Pollstar data was last updated.Gets the population of the city.Gets the southern boundary of the city's region.Gets the timezone of the city.Gets whether the city is a university town.Gets the update timestamp of the city.Gets the western boundary of the city's region.Gets the zone code of the city.Gets the zone name of the city.voidsetBannedAt(Instant bannedAt) Sets the banned timestamp of the city.voidsetCountryCode(String countryCode) Sets the country code of the city.voidsetCountryName(String countryName) Sets the country name of the city.protected voidsetCreatedAt(Instant createdAt) Sets the creation timestamp of the city.voidsetEastRegion(Double eastRegion) Sets the eastern boundary of the city's region.voidsetGeoPoint(org.locationtech.jts.geom.Point geoPoint) Sets the geographical point of the city.voidSets the Google queued timestamp to the current time.voidsetGoogleQueuedAt(Instant googleQueuedAt) Sets the timestamp when the city was last queued for a Google update.voidsetGoogleUpdatedAt(Instant googleUpdatedAt) Sets the timestamp when the city's Google data was last updated.voidSets the URL of an image of the city.voidSets the name of the city.voidsetNorthRegion(Double northRegion) Sets the northern boundary of the city's region.voidsetPlaylist(Playlist playlist) Sets the playlist associated with the city.voidsetPollstarId(String pollstarId) Sets the Pollstar ID of the city.voidSets the Pollstar queued timestamp to the current time.voidsetPollstarQueuedAt(Instant pollstarQueuedAt) Sets the timestamp when the city was last queued for a Pollstar update.voidsetPollstarUpdatedAt(Instant pollstarUpdatedAt) Sets the timestamp when the city's Pollstar data was last updated.voidsetPopulation(Long population) Sets the population of the city.voidsetSouthRegion(Double southRegion) Sets the southern boundary of the city's region.voidsetTimezone(String timezone) Sets the timezone of the city.voidsetUniversity(Boolean university) Sets whether the city is a university town.protected voidsetUpdatedAt(Instant updatedAt) Sets the update timestamp of the city.voidsetWestRegion(Double westRegion) Sets the western boundary of the city's region.voidsetZoneCode(String zoneCode) Sets the zone code of the city.voidsetZoneName(String zoneName) Sets the zone name of the city.toArtistsResponse(boolean isUserLocalCity, org.springframework.data.domain.Page<City.CityArtistApiResponse> topArtists, Integer numberOfArtists, Integer numberTotalVenues, Integer numberUpcomingEvents) Converts this city to an artists response object.toCityArtistProportionResponse(Integer numArtists) Converts this city to a city-artist proportion response object.toExtendedResponse(boolean isFavorite, Integer numberOfArtists, Integer numberTotalVenues, Integer numberUpcomingEvents) Converts this city to an extended response object.Converts this city to a CityResponse excluding the description.
-
Constructor Details
-
City
protected City()Default constructor for JPA. -
City
public City(String name, String zoneCode, String countryCode, org.locationtech.jts.geom.Point geoPoint) Constructs a new City.- Parameters:
name- The name of the city.zoneCode- The zone code of the city.countryCode- The country code of the city.geoPoint- The geographical point of the city.
-
-
Method Details
-
getZoneName
Gets the zone name of the city.- Returns:
- The zone name.
-
setZoneName
Sets the zone name of the city.- Parameters:
zoneName- The zone name.
-
getCountryName
Gets the country name of the city.- Returns:
- The country name.
-
setCountryName
Sets the country name of the city.- Parameters:
countryName- The country name.
-
getNorthRegion
Gets the northern boundary of the city's region.- Returns:
- The northern boundary.
-
setNorthRegion
Sets the northern boundary of the city's region.- Parameters:
northRegion- The northern boundary.
-
getSouthRegion
Gets the southern boundary of the city's region.- Returns:
- The southern boundary.
-
setSouthRegion
Sets the southern boundary of the city's region.- Parameters:
southRegion- The southern boundary.
-
getEastRegion
Gets the eastern boundary of the city's region.- Returns:
- The eastern boundary.
-
setEastRegion
Sets the eastern boundary of the city's region.- Parameters:
eastRegion- The eastern boundary.
-
getWestRegion
Gets the western boundary of the city's region.- Returns:
- The western boundary.
-
setWestRegion
Sets the western boundary of the city's region.- Parameters:
westRegion- The western boundary.
-
getGoogleQueuedAt
Gets the timestamp when the city was last queued for a Google update.- Returns:
- The timestamp.
-
getImage
Gets the URL of an image of the city.- Returns:
- The image URL.
-
setImage
Sets the URL of an image of the city.- Parameters:
image- The image URL.
-
getTimezone
Gets the timezone of the city.- Returns:
- The timezone.
-
setTimezone
Sets the timezone of the city.- Parameters:
timezone- The timezone.
-
getFriendlyName
Gets a friendly name for the city (e.g., "Ithaca, NY").- Returns:
- The friendly name.
-
toResponse
Converts this city to a CityResponse excluding the description.- Returns:
- city response
-
toExtendedResponse
public CityResponseExtended toExtendedResponse(boolean isFavorite, Integer numberOfArtists, Integer numberTotalVenues, Integer numberUpcomingEvents) Converts this city to an extended response object.- Parameters:
isFavorite- Whether the city is a favorite of the user.numberOfArtists- The number of artists in the city.numberTotalVenues- The total number of venues in the city.numberUpcomingEvents- The number of upcoming events in the city.- Returns:
- The extended city response.
-
toArtistsResponse
public CityArtistsResponse toArtistsResponse(boolean isUserLocalCity, org.springframework.data.domain.Page<City.CityArtistApiResponse> topArtists, Integer numberOfArtists, Integer numberTotalVenues, Integer numberUpcomingEvents) Converts this city to an artists response object.- Parameters:
isUserLocalCity- Whether this is the user's local city.topArtists- A page of top artists in the city.numberOfArtists- The number of artists in the city.numberTotalVenues- The total number of venues in the city.numberUpcomingEvents- The number of upcoming events in the city.- Returns:
- The city artists response.
-
getId
Gets the ID of the city.- Returns:
- The ID.
-
getName
Gets the name of the city.- Returns:
- The name.
-
getZoneCode
Gets the zone code of the city.- Returns:
- The zone code.
-
getCountryCode
Gets the country code of the city.- Returns:
- The country code.
-
getPopulation
Gets the population of the city.- Returns:
- The population.
-
getCreatedAt
Gets the creation timestamp of the city.- Returns:
- The creation timestamp.
-
getUpdatedAt
Gets the update timestamp of the city.- Returns:
- The update timestamp.
-
getBannedAt
Gets the banned timestamp of the city.- Returns:
- The banned timestamp.
-
getPlaylist
Gets the playlist associated with the city.- Returns:
- The playlist.
-
setName
Sets the name of the city.- Parameters:
name- The name.
-
setZoneCode
Sets the zone code of the city.- Parameters:
zoneCode- The zone code.
-
setCountryCode
Sets the country code of the city.- Parameters:
countryCode- The country code.
-
getGeoPoint
public org.locationtech.jts.geom.Point getGeoPoint()Gets the geographical point of the city.- Returns:
- The geographical point.
-
setGeoPoint
public void setGeoPoint(org.locationtech.jts.geom.Point geoPoint) Sets the geographical point of the city.- Parameters:
geoPoint- The geographical point.
-
setPopulation
Sets the population of the city.- Parameters:
population- The population.
-
setPlaylist
Sets the playlist associated with the city.- Parameters:
playlist- The playlist.
-
setCreatedAt
Sets the creation timestamp of the city.- Parameters:
createdAt- The creation timestamp.
-
setBannedAt
Sets the banned timestamp of the city.- Parameters:
bannedAt- The banned timestamp.
-
setUpdatedAt
Sets the update timestamp of the city.- Parameters:
updatedAt- The update timestamp.
-
getGoogleUpdatedAt
Gets the timestamp when the city's Google data was last updated.- Returns:
- The timestamp.
-
setGoogleUpdatedAt
Sets the timestamp when the city's Google data was last updated.- Parameters:
googleUpdatedAt- The timestamp.
-
setGoogleQueuedAt
Sets the timestamp when the city was last queued for a Google update.- Parameters:
googleQueuedAt- The timestamp.
-
setGoogleLastQueued
public void setGoogleLastQueued()Sets the Google queued timestamp to the current time. -
getUniversity
Gets whether the city is a university town.- Returns:
- True if the city is a university town, false otherwise.
-
setUniversity
Sets whether the city is a university town.- Parameters:
university- True if the city is a university town, false otherwise.
-
getLatitude
Gets the latitude of the city.- Returns:
- The latitude.
-
getLongitude
Gets the longitude of the city.- Returns:
- The longitude.
-
toCityArtistProportionResponse
Converts this city to a city-artist proportion response object.- Parameters:
numArtists- The number of artists in the city.- Returns:
- The city-artist proportion response.
-
setPollstarQueuedAt
Sets the timestamp when the city was last queued for a Pollstar update.- Parameters:
pollstarQueuedAt- The timestamp.
-
setPollstarLastQueuedAt
public void setPollstarLastQueuedAt()Sets the Pollstar queued timestamp to the current time. -
getPollstarId
Gets the Pollstar ID of the city.- Returns:
- The Pollstar ID.
-
setPollstarId
Sets the Pollstar ID of the city.- Parameters:
pollstarId- The Pollstar ID.
-
getPollstarQueuedAt
Gets the timestamp when the city was last queued for a Pollstar update.- Returns:
- The timestamp.
-
getPollstarUpdatedAt
Gets the timestamp when the city's Pollstar data was last updated.- Returns:
- The timestamp.
-
setPollstarUpdatedAt
Sets the timestamp when the city's Pollstar data was last updated.- Parameters:
pollstarUpdatedAt- The timestamp.
-