package com.mzh.library.entity;

import java.time.LocalDate;

public class SystemLogSearchCriteria {
    private String operationType;
    private String keyword;
    private String createdFromText;
    private String createdToText;
    private LocalDate createdFrom;
    private LocalDate createdTo;

    public SystemLogSearchCriteria() {
        this(null, null, null, null);
    }

    public SystemLogSearchCriteria(String operationType, String keyword, String createdFromText,
                                   String createdToText) {
        this.operationType = trim(operationType);
        this.keyword = trim(keyword);
        this.createdFromText = trim(createdFromText);
        this.createdToText = trim(createdToText);
    }

    public String getOperationType() {
        return operationType;
    }

    public void setOperationType(String operationType) {
        this.operationType = trim(operationType);
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = trim(keyword);
    }

    public String getCreatedFromText() {
        return createdFromText;
    }

    public void setCreatedFromText(String createdFromText) {
        this.createdFromText = trim(createdFromText);
    }

    public String getCreatedToText() {
        return createdToText;
    }

    public void setCreatedToText(String createdToText) {
        this.createdToText = trim(createdToText);
    }

    public LocalDate getCreatedFrom() {
        return createdFrom;
    }

    public void setCreatedFrom(LocalDate createdFrom) {
        this.createdFrom = createdFrom;
    }

    public LocalDate getCreatedTo() {
        return createdTo;
    }

    public void setCreatedTo(LocalDate createdTo) {
        this.createdTo = createdTo;
    }

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