Class UserCity

java.lang.Object
org.localify.user.support.UserCity
All Implemented Interfaces:
Comparable<UserCity>

@Entity public class UserCity extends Object implements Comparable<UserCity>
Represents the association between a user and a city.
  • Constructor Details

    • UserCity

      public UserCity(User user, City city, Double distance)
      Creates a new user city.
      Parameters:
      user - The user.
      city - The city.
      distance - The distance.
    • UserCity

      protected UserCity()
      Default constructor.
  • Method Details

    • setPlaylist

      public void setPlaylist(Playlist playlist)
      Sets the playlist for the user city.
      Parameters:
      playlist - The playlist.
    • select

      public void select()
      Sets the selected at time to now.
    • toResponseContainer

      public UserCityContainer toResponseContainer()
      Converts the user city to a response container.
      Returns:
      The response container.
    • getTimeFrame

      public CitySelectionTimeFrame getTimeFrame()
      Gets the time frame for the user city.
      Returns:
      The time frame.
    • setTimeFrame

      public void setTimeFrame(CitySelectionTimeFrame timeFrame)
      Sets the time frame for the user city.
      Parameters:
      timeFrame - The time frame.
    • getKey

      public UserCity.Key getKey()
      Gets the key for the user city.
      Returns:
      The key.
    • getUser

      public User getUser()
      Gets the user for the user city.
      Returns:
      The user.
    • getCity

      public City getCity()
      Gets the city for the user city.
      Returns:
      The city.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp of the user city.
      Returns:
      The creation timestamp.
    • getUpdatedAt

      public Instant getUpdatedAt()
      Gets the last update timestamp of the user city.
      Returns:
      The last update timestamp.
    • getStartDate

      public Instant getStartDate()
      Gets the start date for the user city.
      Returns:
      The start date.
    • getEndDate

      public Instant getEndDate()
      Gets the end date for the user city.
      Returns:
      The end date.
    • getDistance

      public Double getDistance()
      Gets the distance for the user city.
      Returns:
      The distance.
    • setDistance

      public void setDistance(Double distance)
      Sets the distance for the user city.
      Parameters:
      distance - The distance.
    • getSelectedAt

      public Instant getSelectedAt()
      Gets the selected at time for the user city.
      Returns:
      The selected at time.
    • setSelectedAt

      public void setSelectedAt(Instant selectedAt)
      Sets the selected at time for the user city.
      Parameters:
      selectedAt - The selected at time.
    • setStartDate

      public void setStartDate(Instant startDate)
      Sets the start date for the user city.
      Parameters:
      startDate - The start date.
    • setEndDate

      public void setEndDate(Instant endDate)
      Sets the end date for the user city.
      Parameters:
      endDate - The end date.
    • getSortEventRecsBy

      public RecSortSetting getSortEventRecsBy()
      Gets the sort setting for event recommendations.
      Returns:
      The sort setting.
    • setSortEventRecsBy

      public void setSortEventRecsBy(RecSortSetting sortEventRecsBy)
      Sets the sort setting for event recommendations.
      Parameters:
      sortEventRecsBy - The sort setting.
    • compareTo

      public int compareTo(UserCity o)
      Specified by:
      compareTo in interface Comparable<UserCity>
    • getPlaylist

      public Playlist getPlaylist()
      Gets the playlist for the user city.
      Returns:
      The playlist.