Interface Comments
-
- All Known Implementing Classes:
CommentsImpl
public interface Comments
Offers access to all Comments of all Books.- Author:
- Maximilian Schiedermeier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addComment(long isbn, String comment)
Add a comment to an existing book.void
deleteComment(long isbn, long commentId)
Removes a previously stored comment for a specific book.void
editComment(long isbn, long commentId, String updatedComment)
Overwrites an already existing specific comment for a specific book.Map<Long,String>
getAllCommentsForBook(long isbn)
Returns all comments stored for a specific book.void
removeAllCommentsForBook(long isbn)
Removes all previously stored comments for a specific book.
-
-
-
Method Detail
-
getAllCommentsForBook
Map<Long,String> getAllCommentsForBook(long isbn)
Returns all comments stored for a specific book.- Parameters:
isbn
- as the identifier of the book in question- Returns:
- a map of commentIds to comments.
-
addComment
void addComment(long isbn, String comment)
Add a comment to an existing book. Comments for non-indexed books (isbn not listed in assortmentMap) are rejected.- Parameters:
isbn
- as the identifier of the book in questioncomment
- as a string representing the comment to be added
-
deleteComment
void deleteComment(long isbn, long commentId)
Removes a previously stored comment for a specific book.- Parameters:
isbn
- as the identifier of the book in questioncommentId
- as the id of the comment to be removed
-
removeAllCommentsForBook
void removeAllCommentsForBook(long isbn)
Removes all previously stored comments for a specific book.- Parameters:
isbn
- as the identifier of the book in question
-
editComment
void editComment(long isbn, long commentId, String updatedComment)
Overwrites an already existing specific comment for a specific book.- Parameters:
isbn
- as the identifier of the book in questioncommentId
- as the id of the comment to be overwrittenupdatedComment
- as a string representing the updated comment
-
-