package vn.azteam.tpf.service.dto;

import java.io.Serializable;
import java.util.Objects;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
import io.github.jhipster.service.filter.InstantFilter;

/**
 * Criteria class for the TBProductBlockDetails entity. This class is used in TBProductBlockDetailsResource to
 * receive all the possible filtering options from the Http GET request parameters.
 * For example the following could be a valid requests:
 * <code> /tb-product-block-details?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
public class TBProductBlockDetailsCriteria implements Serializable {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private DoubleFilter quantity;

    private StringFilter code;

    private InstantFilter harvestDate;

    private InstantFilter expDate;

    private IntegerFilter productLevel;

    private LongFilter tbProductUnitId;

    private LongFilter tbCropId;

    private StringFilter tbCropCode;

    private LongFilter tbEntityId;

    private LongFilter tbSuppliesId;

    public LongFilter getId() {
        return id;
    }

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

    public DoubleFilter getQuantity() {
        return quantity;
    }

    public void setQuantity(DoubleFilter quantity) {
        this.quantity = quantity;
    }

    public StringFilter getCode() {
        return code;
    }

    public void setCode(StringFilter code) {
        this.code = code;
    }

    public InstantFilter getHarvestDate() {
        return harvestDate;
    }

    public void setHarvestDate(InstantFilter harvestDate) {
        this.harvestDate = harvestDate;
    }

    public InstantFilter getExpDate() {
        return expDate;
    }

    public void setExpDate(InstantFilter expDate) {
        this.expDate = expDate;
    }

    public IntegerFilter getProductLevel() {
        return productLevel;
    }

    public void setProductLevel(IntegerFilter productLevel) {
        this.productLevel = productLevel;
    }

    public LongFilter getTbProductUnitId() {
        return tbProductUnitId;
    }

    public void setTbProductUnitId(LongFilter tbProductUnitId) {
        this.tbProductUnitId = tbProductUnitId;
    }

    public LongFilter getTbCropId() {
        return tbCropId;
    }

    public void setTbCropId(LongFilter tbCropId) {
        this.tbCropId = tbCropId;
    }

    public StringFilter getTbCropCode() {
        return tbCropCode;
    }

    public void setTbCropCode(StringFilter tbCropCode) {
        this.tbCropCode = tbCropCode;
    }

    public LongFilter getTbEntityId() {
        return tbEntityId;
    }

    public void setTbEntityId(LongFilter tbEntityId) {
        this.tbEntityId = tbEntityId;
    }

    public LongFilter getTbSuppliesId() {
        return tbSuppliesId;
    }

    public void setTbSuppliesId(LongFilter tbSuppliesId) {
        this.tbSuppliesId = tbSuppliesId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TBProductBlockDetailsCriteria that = (TBProductBlockDetailsCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(quantity, that.quantity) &&
            Objects.equals(code, that.code) &&
            Objects.equals(harvestDate, that.harvestDate) &&
            Objects.equals(expDate, that.expDate) &&
            Objects.equals(productLevel, that.productLevel) &&
            Objects.equals(tbProductUnitId, that.tbProductUnitId) &&
            Objects.equals(tbCropId, that.tbCropId) &&
            Objects.equals(tbEntityId, that.tbEntityId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        quantity,
        code,
        harvestDate,
        expDate,
        productLevel,
        tbProductUnitId,
        tbCropId,
            tbEntityId
        );
    }

    @Override
    public String toString() {
        return "TBProductBlockDetailsCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (quantity != null ? "quantity=" + quantity + ", " : "") +
                (code != null ? "code=" + code + ", " : "") +
                (harvestDate != null ? "harvestDate=" + harvestDate + ", " : "") +
                (expDate != null ? "expDate=" + expDate + ", " : "") +
                (productLevel != null ? "productLevel=" + productLevel + ", " : "") +
                (tbProductUnitId != null ? "tbProductUnitId=" + tbProductUnitId + ", " : "") +
                (tbCropId != null ? "tbCropId=" + tbCropId + ", " : "") +
                (tbEntityId != null ? "tbEntityId=" + tbEntityId + ", " : "") +
            "}";
    }

}
