Skip to content

Commit

Permalink
refactor: DBRepository to use generics <K, V>
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheaGjerde committed Mar 2, 2026
1 parent ccdc4a5 commit 5787e12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/edu/group5/app/model/DBRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
* is stored as a {@link HashMap}.
* </p>
*/
public abstract class DBRepository extends Repository {
public abstract class DBRepository<K, V> extends Repository {
/**
* The underlying data structure containing the repository entities.
*/
protected HashMap<Object, Object> content;
protected HashMap<K, V> content;

/**
* Constructs a DBRepository with the given content.
*
* @param content the HashMap used to store repository entities
*/
protected DBRepository(HashMap<Object, Object> content) {
protected DBRepository(HashMap<K, V> content) {
super(content);
this.content = content;
}
Expand All @@ -34,7 +34,7 @@ protected DBRepository(HashMap<Object, Object> content) {
* @return the repository content as a HashMap
*/
@Override
public HashMap<Object, Object> getContent() {
public HashMap<K, V> getContent() {
return content;
}
}

0 comments on commit 5787e12

Please sign in to comment.