115116117118119120121122123124
this.paymentReceived = paymentReceived; } public void addBook(Book book, int quantity) { if (orderState.equals("Open")) { getLines().add(new Line(book, quantity)); } else { throw new IllegalStateException("Can only add books in Open state."); } }
107108109110111112113114115116
this.paymentReceived = paymentReceived; } public void addBook(Book book, int quantity) { if (orderState.equals("Open")) { lines.add(new Line(book, quantity)); } else { throw new IllegalStateException("Can only add books in Open state."); } }