aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-api/src/main/java')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserDAO.java63
1 files changed, 26 insertions, 37 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserDAO.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserDAO.java
index df797b9..5926214 100644
--- a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserDAO.java
+++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserDAO.java
@@ -2,83 +2,72 @@ package com.ufund.api.ufundapi.persistence;
import java.io.IOException;
-import com.ufund.api.ufundapi.model.Need;
+import com.ufund.api.ufundapi.model.User;
+
/**
- * Defines the interface for Need object persistence
+ * Defines the interface for User object persistence
*
* @author Team 2B Jelly Solutions
*/
public interface UserDAO {
/**
- * Retrieves all {@linkplain Need needs}
- *
- * @return An array of {@link Need need} objects, may be empty
- *
- * @throws IOException if an issue with underlying storage
- */
- Need[] getUsers() throws IOException;
-
- /**
- * Finds all {@linkplain Need needs} whose name contains the given text
- *
- * @param targetName The text to match against
+ * Retrieves all {@linkplain User users}
*
- * @return An array of {@link Need needs} whose names contains the given text,
- * may be empty
+ * @return An array of {@link User user} objects, may be empty
*
* @throws IOException if an issue with underlying storage
*/
- Need[] findUsers(String targetName) throws IOException;
+ User[] getUsers() throws IOException;
/**
- * Retrieves a {@linkplain Need need} with the given name
+ * Retrieves a {@linkplain User user} with the given name
*
- * @param id The ID of the {@link Need need} to get
+ * @param id The ID of the {@link User user} to get
*
- * @return a {@link Need need} object with the matching name
+ * @return a {@link User user} object with the matching name
* <br>
- * null if no {@link Need need} with a matching name is found
+ * null if no {@link User user} with a matching name is found
*
* @throws IOException if an issue with underlying storage
*/
- Need getUser(int id) throws IOException;
+ User getUser(String name) throws IOException;
/**
- * Creates and saves a {@linkplain Need need}
+ * Creates and saves a {@linkplain User user}
*
- * @param need {@linkplain Need need} object to be created and saved
+ * @param user {@linkplain User user} object to be created and saved
* <br>
- * The id of the need object is automatically incremented.
+ * The id of the user object is automatically incremented.
*
- * @return new {@link Need need} if successful, null otherwise
+ * @return new {@link User user} if successful, null otherwise
*
* @throws IOException if an issue with underlying storage
*/
- Need createNeed(Need need) throws IOException;
+ User createUser(User user) throws IOException;
/**
- * Updates and saves a {@linkplain Need need}
+ * Updates and saves a {@linkplain User user}
*
- * @param need {@link Need need} object to be updated and saved
+ * @param user {@link User user} object to be updated and saved
*
- * @return updated {@link Need need} if successful, null if
- * {@link Need need} could not be found
+ * @return updated {@link User user} if successful, null if
+ * {@link User user} could not be found
*
* @throws IOException if underlying storage cannot be accessed
*/
- Need updateNeed(Need need) throws IOException;
+ User updateUser(User user) throws IOException;
/**
- * Deletes a {@linkplain Need need} with the given id
+ * Deletes a {@linkplain User user} with the given id
*
- * @param id The id of the {@link Need need}
+ * @param id The id of the {@link User user}
*
- * @return true if the {@link Need need} was deleted
+ * @return true if the {@link User user} was deleted
* <br>
- * false if the need with the given id does not exist
+ * false if the user with the given id does not exist
*
* @throws IOException if underlying storage cannot be accessed
*/
- boolean deleteNeed(int id) throws IOException;
+ boolean deleteUser(String name) throws IOException;
}