package com.twu.biblioteca.model;

public class Movie {

    private String name;
    private int year;
    private String director;
    private int rating;

    public Movie(String name, int year, String director, int rating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.setRating(rating);
    }

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

        Movie movie = (Movie) o;

        if (getYear() != movie.getYear()) return false;
        if (getRating() != movie.getRating()) return false;
        if (getName() != null ? !getName().equals(movie.getName()) : movie.getName() != null) return false;
        return getDirector() != null ? getDirector().equals(movie.getDirector()) : movie.getDirector() == null;
    }

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

    public String getName() {
        return name;
    }

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

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public int getRating() {
        return rating;
    }

    public void setRating(int rating) {
        this.rating = rating <= 10 && rating >= 1 ? rating : 0;
    }
}

@@ -149,16 +149,48 @@
  rating;
+%0A    private boolean isCheckOut;
 %0A%0A    pu
@@ -677,32 +677,94 @@
 ) return false;%0A
+        if (isCheckOut() != movie.isCheckOut()) return false;%0A
         if (getN
@@ -1252,24 +1252,79 @@
 etRating();%0A
+        result = 31 * result + (isCheckOut() ? 1 : 0);%0A
         retu
@@ -1840,32 +1840,32 @@
 g(int rating) %7B%0A
-
         this.rat
@@ -1917,11 +1917,165 @@
 0;%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 ischeckOut field