add setters and protected no-arg constructor

This commit is contained in:
Sabiq Ihab 2017-06-21 00:52:38 +00:00
parent 8208f6252b
commit f3902ffc16
2 changed files with 34 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public class Author {
this.email = email;
}
public Author() {
protected Author() {
super();
}
@ -40,18 +40,34 @@ public class Author {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "Author [name=" + name + ", email=" + email + "]";

View File

@ -34,7 +34,7 @@ public class Book {
this.author = author;
}
public Book() {
protected Book() {
super();
}
@ -42,18 +42,34 @@ public class Book {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public Author getAuthor() {
return author;
}
public void setAuthor(Author author) {
this.author = author;
}
@Override
public String toString() {
return "Book [title=" + title + ", price=" + price + ", author=" + author + "]";