src/com/vehiclerental/logicLayer/implementations/UserServiceImpl.java
/**
     * Search users given a specific criteria
     *
     * @param searchUserContract the search criteria
     * @return a list of user matching the criteria
     * @throws InvalidPropertyException if one of the criteria properties is invalid
     */
Search users given a specific criteria
@param searchUserContract the search criteria
@return a list of user matching the criteria
@throws InvalidPropertyException if one of the criteria properties is invalid
Search users given a specific criteria @param searchUserContract the search criteria @return a list of user matching the criteria @throws InvalidPropertyException if one of the criteria properties is invalid
@Override
    public List<User> searchUser(SearchUserContract searchUserContract) throws InvalidPropertyException {
        if (searchUserContract.searchTerm.length() < 2) {
            throw new InvalidPropertyException("Search criteria must be at least two characters");
        }
        List<User> users = userDao.searchUsers(searchUserContract.searchTerm);
        for (User user : users) {
            user.decrypt();
        }
        return users;
    }
@ Override public List < User > searchUser ( SearchUserContract searchUserContract ) throws InvalidPropertyException { if ( searchUserContract . searchTerm . length ( ) < 2 ) { throw new InvalidPropertyException ( "Search criteria must be at least two characters" ) ; } List < User > users = userDao . searchUsers ( searchUserContract . searchTerm ) ; for ( User user : users ) { user . decrypt ( ) ; } return users ; }
Search users given a specific criteria
 @param searchUserContract the search criteria
 @return a list of user matching the criteria
 @throws InvalidPropertyException if one of the criteria properties is invalid
Search users given a specific criteria @param searchUserContract the search criteria @return a list of user matching the criteria @throws InvalidPropertyException if one of the criteria properties is invalid
//User are encrypted by default, we need to decrypt