From 2330f3ad4c47bbacbe23ccc2c39af852c3754b93 Mon Sep 17 00:00:00 2001 From: Fredrik Marjoni Date: Thu, 23 Apr 2026 22:10:07 +0200 Subject: [PATCH] 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); }