package com.mzh.library.entity;

public class BorrowRecordSearchCriteria {
    public static final String OVERDUE_STATUS = "overdue";

    private String readerIdentifier;
    private String bookIdentifier;
    private String statusCode;

    public BorrowRecordSearchCriteria() {
    }

    public BorrowRecordSearchCriteria(String readerIdentifier, String bookIdentifier, String statusCode) {
        this.readerIdentifier = trim(readerIdentifier);
        this.bookIdentifier = trim(bookIdentifier);
        this.statusCode = trim(statusCode);
    }

    public String getReaderIdentifier() {
        return readerIdentifier;
    }

    public void setReaderIdentifier(String readerIdentifier) {
        this.readerIdentifier = trim(readerIdentifier);
    }

    public String getBookIdentifier() {
        return bookIdentifier;
    }

    public void setBookIdentifier(String bookIdentifier) {
        this.bookIdentifier = trim(bookIdentifier);
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = trim(statusCode);
    }

    public boolean isOverdueOnly() {
        return OVERDUE_STATUS.equals(statusCode);
    }

    private String trim(String value) {
        return value == null ? "" : value.trim();
    }
}
