-
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.
- Loading branch information
Robin Strand Prestmo
committed
Feb 19, 2026
1 parent
d3ce9d4
commit 6e4393d
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 25 additions & 1 deletion
26
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Inbox.java
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,5 +1,29 @@ | ||
| package ntnu.sytemutvikling.team6.models; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| // Unntakshåndtering mangler | ||
| // Enhetstester mangler | ||
| // Message får kanskje en UUID, da er det mer fornuftig å bruke denne, vertfall for removeMessage | ||
|
|
||
| public class Inbox { | ||
|
|
||
| private final List<Message> messages; | ||
|
|
||
| public Inbox(){ | ||
| this.messages = new ArrayList<>(); | ||
| } | ||
|
|
||
| public List<Message> getMessages() { | ||
| return Collections.unmodifiableList(messages); | ||
| } | ||
|
|
||
| public void addMessage(Message message) { | ||
| messages.add(message); | ||
| } | ||
|
|
||
| public boolean removeMessage(Message message) { | ||
| return messages.remove(message); | ||
| } | ||
| } |