Interface UsersOperations


  • public interface UsersOperations
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Integer addUser​(java.lang.String username)
      Adds a new user with the given username.
      boolean doesUserExist​(java.lang.String username)
      Checks whether a user with the specified username exists.
      java.util.List<java.lang.Integer> getAllUserIds()
      Retrieves a list of unique identifiers (IDs) for all users.
      java.util.List<java.lang.Integer> getRecommendedMoviesFromFavoriteGenres​(java.lang.Integer userId)
      Retrieves recommended movies for the given user based on their favorite genres.
      java.lang.Integer getRewards​(java.lang.Integer userId)
      Returns the number of rewards earned by the specified user.
      java.util.List<java.lang.String> getThematicSpecializations​(java.lang.Integer userId)
      Retrieves the list of thematic specializations (tags) for the specified user.
      java.lang.String getUserDescription​(java.lang.Integer userId)
      Retrieves a descriptive status of the specified user based on their rating behavior.
      java.lang.Integer getUserId​(java.lang.String username)
      Retrieves the unique identifier (ID) of a user based on their username.
      java.lang.Integer removeUser​(java.lang.Integer id)
      Removes a user with the specified unique identifier.
      java.lang.Integer updateUser​(java.lang.Integer id, java.lang.String newUsername)
      Updates the username of an existing user identified by their unique identifier.
    • Method Detail

      • addUser

        java.lang.Integer addUser​(java.lang.String username)
        Adds a new user with the given username.
        Parameters:
        username - the username of the user to be added
        Returns:
        the unique identifier (ID) assigned to the newly added user
      • updateUser

        java.lang.Integer updateUser​(java.lang.Integer id,
                                     java.lang.String newUsername)
        Updates the username of an existing user identified by their unique identifier.
        Parameters:
        id - the unique identifier of the user to update
        newUsername - the new username to assign to the user
        Returns:
        the unique identifier of the updated user, or null if no user exists with the specified identifier
      • removeUser

        java.lang.Integer removeUser​(java.lang.Integer id)
        Removes a user with the specified unique identifier.
        Parameters:
        id - the unique identifier of the user to be removed
        Returns:
        the unique identifier of the removed user, or null if no user exists with the specified id
      • doesUserExist

        boolean doesUserExist​(java.lang.String username)
        Checks whether a user with the specified username exists.
        Parameters:
        username - the username to check for existence
        Returns:
        true if the user exists, false otherwise
      • getUserId

        java.lang.Integer getUserId​(java.lang.String username)
        Retrieves the unique identifier (ID) of a user based on their username.
        Parameters:
        username - the username of the user whose ID is to be retrieved
        Returns:
        the unique identifier of the user, or null if no user exists with the specified username
      • getAllUserIds

        java.util.List<java.lang.Integer> getAllUserIds()
        Retrieves a list of unique identifiers (IDs) for all users.
        Returns:
        a list of user IDs, or an empty list if no users exist
      • getRecommendedMoviesFromFavoriteGenres

        java.util.List<java.lang.Integer> getRecommendedMoviesFromFavoriteGenres​(java.lang.Integer userId)
        Retrieves recommended movies for the given user based on their favorite genres.
        Parameters:
        userId - the unique identifier of the user
        Returns:
        a list of movie IDs that match the recommendation criteria; an empty list if none found
      • getRewards

        java.lang.Integer getRewards​(java.lang.Integer userId)
        Returns the number of rewards earned by the specified user.
        Parameters:
        userId - the unique identifier of the user
        Returns:
        the number of rewards earned by the user (0 if none)
      • getThematicSpecializations

        java.util.List<java.lang.String> getThematicSpecializations​(java.lang.Integer userId)
        Retrieves the list of thematic specializations (tags) for the specified user.
        Parameters:
        userId - the unique identifier of the user
        Returns:
        a list of tags representing the user's thematic specializations; an empty list if no specialization is found
      • getUserDescription

        java.lang.String getUserDescription​(java.lang.Integer userId)
        Retrieves a descriptive status of the specified user based on their rating behavior.
        Parameters:
        userId - the unique identifier of the user
        Returns:
        a string representing the description of the user: "curious", "focused", or "undefined"