From 2330f3ad4c47bbacbe23ccc2c39af852c3754b93 Mon Sep 17 00:00:00 2001 From: Fredrik Marjoni Date: Thu, 23 Apr 2026 22:10:07 +0200 Subject: [PATCH 1/3] chore[user]: Add JavaDoc to UserRepository --- .../edu/group5/app/model/user/UserRepository.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/group5/app/model/user/UserRepository.java b/src/main/java/edu/group5/app/model/user/UserRepository.java index ea63bb8..892b11c 100644 --- a/src/main/java/edu/group5/app/model/user/UserRepository.java +++ b/src/main/java/edu/group5/app/model/user/UserRepository.java @@ -6,7 +6,11 @@ import edu.group5.app.model.DBRepository; import edu.group5.app.utils.ParameterValidator; - +/** + * Repository class for managing User entities. It provides methods to retrieve users, + * find users by their unique identifier or email address, and initializes the repository with input data. + * The repository uses a HashMap to store User objects for efficient retrieval based on their unique identifier. + */ public class UserRepository extends DBRepository { public final static String ROLE_CUSTOMER = "Customer"; @@ -69,6 +73,11 @@ public List export() { } + /** + * Retrieves a copy of the current users in the repository. + * @return a HashMap containing the current users, + * where the key is the user ID and the value is the User object + */ public HashMap getUsers() { return new HashMap<>(content); } From 75915e5614a3b92bb4a662817c139b2a979b3407 Mon Sep 17 00:00:00 2001 From: Fredrik Marjoni Date: Thu, 23 Apr 2026 22:18:07 +0200 Subject: [PATCH 2/3] chore[wrapper]: add more proper JavaDoc to the Wrapper class description --- src/main/java/edu/group5/app/model/wrapper/DbWrapper.java | 4 +++- src/main/java/edu/group5/app/model/wrapper/OrgApiWrapper.java | 3 ++- src/main/java/edu/group5/app/model/wrapper/Wrapper.java | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/group5/app/model/wrapper/DbWrapper.java b/src/main/java/edu/group5/app/model/wrapper/DbWrapper.java index 3325b8c..d0239ae 100644 --- a/src/main/java/edu/group5/app/model/wrapper/DbWrapper.java +++ b/src/main/java/edu/group5/app/model/wrapper/DbWrapper.java @@ -14,7 +14,9 @@ import java.util.logging.Logger; /** - * A class for wrapping the database. + * A class for wrapping the database. It provides methods for connecting and disconnecting to the database, + * importing and exporting users and donations, and handling SQL exceptions. + * The class uses a logger to log important events and exceptions that occur during database operations. */ public class DbWrapper { protected Connection connection; diff --git a/src/main/java/edu/group5/app/model/wrapper/OrgApiWrapper.java b/src/main/java/edu/group5/app/model/wrapper/OrgApiWrapper.java index 2a493e4..d2ebb1a 100644 --- a/src/main/java/edu/group5/app/model/wrapper/OrgApiWrapper.java +++ b/src/main/java/edu/group5/app/model/wrapper/OrgApiWrapper.java @@ -10,7 +10,8 @@ import tools.jackson.databind.ObjectMapper; /** - * A Class for Wrapping an API. + * A Class for Wrapping an API. + * It provides methods for importing data from the API and accessing the imported data. */ public class OrgApiWrapper extends Wrapper { private Object[] data; diff --git a/src/main/java/edu/group5/app/model/wrapper/Wrapper.java b/src/main/java/edu/group5/app/model/wrapper/Wrapper.java index 85d8dc8..cc54c29 100644 --- a/src/main/java/edu/group5/app/model/wrapper/Wrapper.java +++ b/src/main/java/edu/group5/app/model/wrapper/Wrapper.java @@ -2,6 +2,9 @@ /** * An abstract class for all Wrappers of datasets. + * This class defines the structure for dataset wrappers, which are responsible for importing data from various sources + * and providing access to the imported data. Each wrapper must implement the importData method to handle the specific + * data import logic and the getData method to return the imported data in a suitable format. */ abstract class Wrapper { From 46addb5ba6b4377750ed66a8ccdaeb8c0ff4c2e9 Mon Sep 17 00:00:00 2001 From: Fredrik Marjoni Date: Thu, 23 Apr 2026 22:46:19 +0200 Subject: [PATCH 3/3] chore[user]: format JavaDoc to be more compact --- .../java/edu/group5/app/model/user/UserRepository.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/group5/app/model/user/UserRepository.java b/src/main/java/edu/group5/app/model/user/UserRepository.java index 892b11c..aec3e9d 100644 --- a/src/main/java/edu/group5/app/model/user/UserRepository.java +++ b/src/main/java/edu/group5/app/model/user/UserRepository.java @@ -7,9 +7,11 @@ import edu.group5.app.model.DBRepository; import edu.group5.app.utils.ParameterValidator; /** - * Repository class for managing User entities. It provides methods to retrieve users, - * find users by their unique identifier or email address, and initializes the repository with input data. - * The repository uses a HashMap to store User objects for efficient retrieval based on their unique identifier. + * Repository class for managing User entities. + * It provides methods to retrieve users, find users by their unique identifier + * or email address, and initializes the repository with input data. + * The repository uses a HashMap to store + * User objects for efficient retrieval based on their unique identifier. */ public class UserRepository extends DBRepository { public final static String ROLE_CUSTOMER = "Customer";