-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: created the abstract class DBRepository
- Loading branch information
MatheaGjerde
committed
Mar 2, 2026
1 parent
d838299
commit ccdc4a5
Showing
1 changed file
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,40 @@ | ||
| package edu.group5.app.model; | ||
|
|
||
| public class DBRepository { | ||
|
|
||
| import java.util.HashMap; | ||
|
|
||
| /** | ||
| * Abstract base class for repositories that store their data | ||
| * in a database-related structure. | ||
| * | ||
| * <p> | ||
| * Extends {@link Repository} and specifies that the content | ||
| * is stored as a {@link HashMap}. | ||
| * </p> | ||
| */ | ||
| public abstract class DBRepository extends Repository { | ||
| /** | ||
| * The underlying data structure containing the repository entities. | ||
| */ | ||
| protected HashMap<Object, Object> content; | ||
|
|
||
| /** | ||
| * Constructs a DBRepository with the given content. | ||
| * | ||
| * @param content the HashMap used to store repository entities | ||
| */ | ||
| protected DBRepository(HashMap<Object, Object> content) { | ||
| super(content); | ||
| this.content = content; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the underlying HashMap containing the repository entities. | ||
| * | ||
| * @return the repository content as a HashMap | ||
| */ | ||
| @Override | ||
| public HashMap<Object, Object> getContent() { | ||
| return content; | ||
| } | ||
| } |