Class UserFinder

java.lang.Object
main.controller.account.user.UserFinder

public class UserFinder extends Object
A class that provides a utility for finding users in the database.
  • Constructor Details

    • UserFinder

      public UserFinder()
  • Method Details

    • findStudent

      private static User findStudent(String userID) throws ModelNotFoundException
      Finds the user with the specified ID.
      Parameters:
      userID - the ID of the user to be found
      Returns:
      the user with the specified ID
      Throws:
      ModelNotFoundException - if the user is not found
    • findFaculty

      private static User findFaculty(String userID) throws ModelNotFoundException
      Finds the faculty with the specified ID.
      Parameters:
      userID - the ID of the faculty to be found
      Returns:
      the faculty with the specified ID
      Throws:
      ModelNotFoundException - if the faculty is not found
    • findCoordinator

      private static User findCoordinator(String userID) throws ModelNotFoundException
      Finds the coordinator with the specified ID.
      Parameters:
      userID - the ID of the coordinator to be found
      Returns:
      the coordinator with the specified ID
      Throws:
      ModelNotFoundException - if the coordinator is not found
    • findUser

      public static User findUser(String userID, UserType userType) throws ModelNotFoundException
      Finds the user with the specified ID.
      Parameters:
      userID - the ID of the user to be found
      userType - the type of the user to be found
      Returns:
      the user with the specified ID
      Throws:
      ModelNotFoundException - if the user is not found