package com.twu.biblioteca.model;

public class Book {
    private int yearPublished;
    private String author;
    private String name;

    public Book(String name) {
        this.name = name;
    }

    public Book(String name, String author, int yearPublished) {
        this.name = name;
        this.author = author;
        this.yearPublished = yearPublished;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        if (getYearPublished() != book.getYearPublished()) return false;
        if (getAuthor() != null ? !getAuthor().equals(book.getAuthor()) : book.getAuthor() != null) return false;
        return getName() != null ? getName().equals(book.getName()) : book.getName() == null;
    }

    @Override
    public int hashCode() {
        int result = getYearPublished();
        result = 31 * result + (getAuthor() != null ? getAuthor().hashCode() : 0);
        result = 31 * result + (getName() != null ? getName().hashCode() : 0);
        return result;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getYearPublished() {
        return yearPublished;
    }

    public void setYearPublished(int yearPublished) {
        this.yearPublished = yearPublished;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String loadDetail() {
        return String.format("%s, %s, %d", getName(), getAuthor(), getYearPublished());
    }
}

@@ -130,16 +130,48 @@
 ng name;
+%0A    private boolean isCheckout;
 %0A%0A    pu
@@ -652,32 +652,93 @@
 ) return false;%0A
+        if (isCheckout() != book.isCheckout()) return false;%0A
         if (getA
@@ -1173,32 +1173,87 @@
 ashCode() : 0);%0A
+        result = 31 * result + (isCheckout() ? 1 : 0);%0A
         return r
@@ -1745,24 +1745,24 @@
 dDetail() %7B%0A
-
         retu
@@ -1842,11 +1842,165 @@
 );%0A    %7D
+%0A%0A    public boolean isCheckout() %7B%0A        return isCheckout;%0A    %7D%0A%0A    public void setCheckout(boolean checkout) %7B%0A        isCheckout = checkout;%0A    %7D
 %0A%7D%0A

add field isCheckout in model Book