-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Book and BookShelf models #45
Conversation
takuyakanbr
commented
Mar 8, 2018
- Add Book and its components
- Add UniqueBookList
- Add BookShelf
- Add unit tests for new classes
} | ||
} | ||
|
||
//// person-level operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
book
|
||
this.bookShelf = new BookShelf(bookShelf); | ||
this.filteredBooks = new FilteredList<>(this.bookShelf.getBookList()); | ||
this.addressBook = new AddressBook(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed for now to keep tests from failing
@Override | ||
public void deleteBook(Book target) throws BookNotFoundException { | ||
bookShelf.removeBook(target); | ||
indicateAddressBookChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicateBookShelfChanged
public void addBook(Book book) throws DuplicateBookException { | ||
bookShelf.addBook(book); | ||
updateFilteredBookList(PREDICATE_SHOW_ALL_BOOKS); | ||
indicateAddressBookChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicateBookShelfChanged
requireAllNonNull(target, editedBook); | ||
|
||
bookShelf.updateBook(target, editedBook); | ||
indicateAddressBookChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicateBookShelfChanged
} | ||
|
||
@Override | ||
public String toString() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean this looks legit? o_o
/** | ||
* Constructs a {@code Category}. | ||
* | ||
* @param category A valid category. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does valid even mean here
/** | ||
* Constructs a {@code Description}. | ||
* | ||
* @param description A valid description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you must love the word valid a lot
* | ||
* Supports a minimal set of list operations. | ||
*/ | ||
public class UniqueBookList implements Iterable<Book> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not extending UniqueList?
this.internalList.setAll(replacement.internalList); | ||
} | ||
|
||
public void setBooks(List<Book> books) throws DuplicateBookException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can replace with Collection