Skip to content

Commit

Permalink
feat: created the abstract class DBRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheaGjerde committed Mar 2, 2026
1 parent d838299 commit ccdc4a5
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion src/main/java/edu/group5/app/model/DBRepository.java
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;
}
}

0 comments on commit ccdc4a5

Please sign in to comment.