Package rs.ac.bg.etf.sab.operations
Interface WatchlistsOperations
-
public interface WatchlistsOperations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddMovieToWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Adds a movie to a user's watchlist.java.util.List<java.lang.Integer>getMoviesInWatchlist(java.lang.Integer userId)Retrieves all movies in a user's watchlist.java.util.List<java.lang.Integer>getUsersWithMovieInWatchlist(java.lang.Integer movieId)Retrieves all users who have a specific movie in their watchlist.booleanisMovieInWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Checks if a movie is in a user's watchlist.booleanremoveMovieFromWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Removes a movie from a user's watchlist.
-
-
-
Method Detail
-
addMovieToWatchlist
boolean addMovieToWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Adds a movie to a user's watchlist.- Parameters:
userId- the unique identifier of the usermovieId- the unique identifier of the movie- Returns:
- true if the movie was successfully added, false if it is already in the watchlist
-
removeMovieFromWatchlist
boolean removeMovieFromWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Removes a movie from a user's watchlist.- Parameters:
userId- the unique identifier of the usermovieId- the unique identifier of the movie- Returns:
- true if the movie was successfully removed, false if it was not in the watchlist
-
isMovieInWatchlist
boolean isMovieInWatchlist(java.lang.Integer userId, java.lang.Integer movieId)Checks if a movie is in a user's watchlist.- Parameters:
userId- the unique identifier of the usermovieId- the unique identifier of the movie- Returns:
- true if the movie exists in the user's watchlist, false otherwise
-
getMoviesInWatchlist
java.util.List<java.lang.Integer> getMoviesInWatchlist(java.lang.Integer userId)
Retrieves all movies in a user's watchlist.- Parameters:
userId- the unique identifier of the user- Returns:
- a list of movie IDs in the user's watchlist, or an empty list if none exist
-
getUsersWithMovieInWatchlist
java.util.List<java.lang.Integer> getUsersWithMovieInWatchlist(java.lang.Integer movieId)
Retrieves all users who have a specific movie in their watchlist.- Parameters:
movieId- the unique identifier of the movie- Returns:
- a list of user IDs who have added the movie to their watchlist, or an empty list if no users have added it
-
-