Skip to content

Commit

Permalink
Added javadoc to Inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Strand Prestmo authored and Robin Strand Prestmo committed Feb 19, 2026
1 parent 6e4393d commit 806dbbc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@
// Enhetstester mangler
// Message får kanskje en UUID, da er det mer fornuftig å bruke denne, vertfall for removeMessage

/**
* Represents a users inbox that contains messages.
* Provides methods to add, remove and get messages.
*
* @Author Robin Strand Prestmo
*/
public class Inbox {
private final List<Message> messages;

/**
* Creates an empty inbox with no messages.
*/
public Inbox(){
this.messages = new ArrayList<>();
}

/**
* Returns an unmodifiable view of the messages in this inbox.
*
* @return an unmodifiable list of messages.
*/
public List<Message> getMessages() {
return Collections.unmodifiableList(messages);
}
Expand All @@ -23,6 +37,12 @@ public void addMessage(Message message) {
messages.add(message);
}

/**
* Removes a message from the inbox list.
*
* @param message the message to be removed
* @return true if the message was removed, false if not found.
*/
public boolean removeMessage(Message message) {
return messages.remove(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class Settings {
* @param language choose language
* @param anonymous choose if user is anonymous
*
* @Author Robin Strand Prestmo
*/
public Settings(boolean lightMode, String language, boolean anonymous) {
this.lightMode = lightMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class User {
* @param settings the user´s settings
* @param inbox the user´s inbox
*
* @Author Robin Strand Prestmo
*/
public User(UUID id,
String name,
Expand Down

0 comments on commit 806dbbc

Please sign in to comment.