diff --git a/src/model/Book.java b/src/model/Book.java index 1191b14..ddd15a1 100644 --- a/src/model/Book.java +++ b/src/model/Book.java @@ -7,18 +7,26 @@ public class Book { private int publicationYear; private boolean isBorrowed; + +//Constructor + public Book(String title,String author,String isbn,int publicationYear,boolean isBorrowed){ + this.title=title; + this.author=author; + this.isbn=isbn;this.publicationYear=publicationYear; + this.isBorrowed=isBorrowed; + } +//Setter public void borrowBook() { - // TODO: Implement method 'borrowBook'. - throw new UnsupportedOperationException("Unimplemented method 'borrowBook'"); + this.isBorrowed=true; } public void returnBook() { - // TODO: Implement method 'returnBook'. - throw new UnsupportedOperationException("Unimplemented method 'returnBook'"); - } - - public void getDetails() { - // TODO: Implement method 'getDetails'. - throw new UnsupportedOperationException("Unimplemented method 'getDetails'"); + this.isBorrowed=false; } +//Getter + public String getTitle() {return this.title;} + public String getAuthor() {return this.author;} + public String getIsbn() {return this.isbn;} + public Integer getPublicationYear() {return this.publicationYear;} + public boolean getIsBorrowed() {return this.isBorrowed;} } diff --git a/src/model/Category.java b/src/model/Category.java index 81700eb..e1e52ac 100644 --- a/src/model/Category.java +++ b/src/model/Category.java @@ -3,14 +3,16 @@ public class Category { private String name; private String description; - - public void getName() { - // TODO: Implement method 'getName'. - throw new UnsupportedOperationException("Unimplemented method 'getName'"); +//Constructor + public Category(String name,String description){ + this.name=name; + this.description=description; } - - public void getDescription() { - // TODO: Implement method 'getDescription'. - throw new UnsupportedOperationException("Unimplemented method 'getDescription'"); +//Getter + public String getName() { + return this.name; + } + public String getDescription() { + return this.description; } }