package com.mzh.library.entity;

public class BookSearchCriteria {
    private String identifier;
    private String title;
    private String author;
    private Long categoryId;

    public BookSearchCriteria() {
    }

    public BookSearchCriteria(String identifier, String title, String author, Long categoryId) {
        this.identifier = trim(identifier);
        this.title = trim(title);
        this.author = trim(author);
        this.categoryId = categoryId;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = trim(identifier);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = trim(title);
    }

    public String getAuthor() {
        return author;
    }

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

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

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