package cz.muni.fi.pa165.dto;

import cz.muni.fi.pa165.enums.BookState;
import java.util.Date;
import java.util.Objects;

/**
 *
 * @author xkubist
 * @email m.kubistel@gmail.com
 */
public class LoanDTO {
    
    private Long id;
    private Date loanDate;
    private Boolean returned;
    private Date returnDate;
    private BookState returnBookState;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getLoanDate() {
        return loanDate;
    }

    public void setLoanDate(Date loanDate) {
        this.loanDate = loanDate;
    }

    public Boolean getReturned() {
        return returned;
    }

    public void setReturned(Boolean returned) {
        this.returned = returned;
    }

    public Date getReturnDate() {
        return returnDate;
    }

    public void setReturnDate(Date returnDate) {
        this.returnDate = returnDate;
    }

    public BookState getReturnBookState() {
        return returnBookState;
    }

    public void setReturnBookState(BookState returnBookState) {
        this.returnBookState = returnBookState;
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 23 * hash + Objects.hashCode(this.id);
        hash = 23 * hash + Objects.hashCode(this.loanDate);
        hash = 23 * hash + Objects.hashCode(this.returned);
        hash = 23 * hash + Objects.hashCode(this.returnDate);
        hash = 23 * hash + Objects.hashCode(this.returnBookState);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LoanDTO other = (LoanDTO) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        if (!Objects.equals(this.loanDate, other.loanDate)) {
            return false;
        }
        if (!Objects.equals(this.returned, other.returned)) {
            return false;
        }
        if (!Objects.equals(this.returnDate, other.returnDate)) {
            return false;
        }
        if (this.returnBookState != other.returnBookState) {
            return false;
        }
        return true;
    }
}

@@ -221,17 +221,48 @@
 te Long 
-i
+LoanId;%0A    private Long MemberI
 d;%0A    p
@@ -401,16 +401,22 @@
 Long get
+Member
 Id() %7B%0A 
@@ -429,17 +429,23 @@
  return 
-i
+MemberI
 d;%0A    %7D
@@ -469,16 +469,22 @@
  set
+Member
 Id(Long 
 id) 
@@ -479,17 +479,23 @@
 Id(Long 
-i
+MemberI
 d) %7B%0A   
@@ -508,14 +508,168 @@
 his.
-id = i
+MemberId = MemberId;%0A    %7D%0A    %0A    public Long getLoanId() %7B%0A        return LoanId;%0A    %7D%0A%0A    public void setLoanId(Long LoanId) %7B%0A        this.LoanId = LoanI
 d;%0A 
@@ -1461,17 +1461,21 @@
 de(this.
-i
+LoanI
 d);%0A    
@@ -2022,17 +2022,21 @@
 ls(this.
-i
+LoanI
 d, other
@@ -2036,17 +2036,21 @@
 , other.
-i
+LoanI
 d)) %7B%0A  

add member id into LoanDTO class