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;

/**
 * Criteria class for the TBHarvest entity. This class is used in TBHarvestResource to
 * receive all the possible filtering options from the Http GET request parameters.
 * For example the following could be a valid requests:
 * <code> /tb-harvests?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 TBHarvestCriteria implements Serializable {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private DoubleFilter totalQuantity;

    private DoubleFilter collectedQuantityLv1;

    private DoubleFilter collectedQuantityLv2;

    private DoubleFilter collectedQuantityLv3;

    private DoubleFilter removedQuantity;

    private DoubleFilter lossPercent;

    private LongFilter tbActivityId;

    public LongFilter getId() {
        return id;
    }

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

    public DoubleFilter getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(DoubleFilter totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public DoubleFilter getCollectedQuantityLv1() {
        return collectedQuantityLv1;
    }

    public void setCollectedQuantityLv1(DoubleFilter collectedQuantityLv1) {
        this.collectedQuantityLv1 = collectedQuantityLv1;
    }

    public DoubleFilter getCollectedQuantityLv2() {
        return collectedQuantityLv2;
    }

    public void setCollectedQuantityLv2(DoubleFilter collectedQuantityLv2) {
        this.collectedQuantityLv2 = collectedQuantityLv2;
    }

    public DoubleFilter getCollectedQuantityLv3() {
        return collectedQuantityLv3;
    }

    public void setCollectedQuantityLv3(DoubleFilter collectedQuantityLv3) {
        this.collectedQuantityLv3 = collectedQuantityLv3;
    }

    public DoubleFilter getRemovedQuantity() {
        return removedQuantity;
    }

    public void setRemovedQuantity(DoubleFilter removedQuantity) {
        this.removedQuantity = removedQuantity;
    }

    public DoubleFilter getLossPercent() {
        return lossPercent;
    }

    public void setLossPercent(DoubleFilter lossPercent) {
        this.lossPercent = lossPercent;
    }

    public LongFilter getTbActivityId() {
        return tbActivityId;
    }

    public void setTbActivityId(LongFilter tbActivityId) {
        this.tbActivityId = tbActivityId;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TBHarvestCriteria that = (TBHarvestCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(totalQuantity, that.totalQuantity) &&
            Objects.equals(collectedQuantityLv1, that.collectedQuantityLv1) &&
            Objects.equals(collectedQuantityLv2, that.collectedQuantityLv2) &&
            Objects.equals(collectedQuantityLv3, that.collectedQuantityLv3) &&
            Objects.equals(removedQuantity, that.removedQuantity) &&
            Objects.equals(lossPercent, that.lossPercent) &&
            Objects.equals(tbActivityId, that.tbActivityId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        totalQuantity,
        collectedQuantityLv1,
        collectedQuantityLv2,
        collectedQuantityLv3,
        removedQuantity,
        lossPercent,
        tbActivityId
        );
    }

    @Override
    public String toString() {
        return "TBHarvestCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (totalQuantity != null ? "totalQuantity=" + totalQuantity + ", " : "") +
                (collectedQuantityLv1 != null ? "collectedQuantityLv1=" + collectedQuantityLv1 + ", " : "") +
                (collectedQuantityLv2 != null ? "collectedQuantityLv2=" + collectedQuantityLv2 + ", " : "") +
                (collectedQuantityLv3 != null ? "collectedQuantityLv3=" + collectedQuantityLv3 + ", " : "") +
                (removedQuantity != null ? "removedQuantity=" + removedQuantity + ", " : "") +
                (lossPercent != null ? "lossPercent=" + lossPercent + ", " : "") +
                (tbActivityId != null ? "tbActivityId=" + tbActivityId + ", " : "") +
            "}";
    }

}
