package vn.azteam.tpf.service.dto;

import java.io.Serializable;
import java.util.Objects;

import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
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 TBEntity entity. This class is used in TBEntityResource to
 * receive all the possible filtering options from the Http GET request parameters.
 * For example the following could be a valid requests:
 * <code> /tb-entities?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 TBEntityCriteria implements Serializable {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter qrCode;

    private StringFilter name;

    private DoubleFilter areaM2;

    private IntegerFilter level;

    private StringFilter status;

    private InstantFilter createdDate;

    private InstantFilter modifiedDate;

    private InstantFilter deletedDate;

    private LongFilter parentId;

    private LongFilter tbAddressId;

    private LongFilter createdById;

    private LongFilter modifiedById;

    private LongFilter deletedById;

    private LongFilter tbCustomerId;

    private LongFilter tbEntityTypeId;

    public LongFilter getId() {
        return id;
    }

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

    public StringFilter getQrCode() {
        return qrCode;
    }

    public void setQrCode(StringFilter qrCode) {
        this.qrCode = qrCode;
    }

    public StringFilter getName() {
        return name;
    }

    public void setName(StringFilter name) {
        this.name = name;
    }

    public DoubleFilter getAreaM2() {
        return areaM2;
    }

    public void setAreaM2(DoubleFilter areaM2) {
        this.areaM2 = areaM2;
    }

    public IntegerFilter getLevel() {
        return level;
    }

    public void setLevel(IntegerFilter level) {
        this.level = level;
    }

    public StringFilter getStatus() {
        return status;
    }

    public void setStatus(StringFilter status) {
        this.status = status;
    }

    public InstantFilter getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(InstantFilter createdDate) {
        this.createdDate = createdDate;
    }

    public InstantFilter getModifiedDate() {
        return modifiedDate;
    }

    public void setModifiedDate(InstantFilter modifiedDate) {
        this.modifiedDate = modifiedDate;
    }

    public InstantFilter getDeletedDate() {
        return deletedDate;
    }

    public void setDeletedDate(InstantFilter deletedDate) {
        this.deletedDate = deletedDate;
    }

    public LongFilter getParentId() {
        return parentId;
    }

    public void setParentId(LongFilter parentId) {
        this.parentId = parentId;
    }

    public LongFilter getTbAddressId() {
        return tbAddressId;
    }

    public void setTbAddressId(LongFilter tbAddressId) {
        this.tbAddressId = tbAddressId;
    }

    public LongFilter getCreatedById() {
        return createdById;
    }

    public void setCreatedById(LongFilter createdById) {
        this.createdById = createdById;
    }

    public LongFilter getModifiedById() {
        return modifiedById;
    }

    public void setModifiedById(LongFilter modifiedById) {
        this.modifiedById = modifiedById;
    }

    public LongFilter getDeletedById() {
        return deletedById;
    }

    public void setDeletedById(LongFilter deletedById) {
        this.deletedById = deletedById;
    }

    public LongFilter getTbCustomerId() {
        return tbCustomerId;
    }

    public void setTbCustomerId(LongFilter tbCustomerId) {
        this.tbCustomerId = tbCustomerId;
    }

    public LongFilter getTbEntityTypeId() {
        return tbEntityTypeId;
    }

    public void setTbEntityTypeId(LongFilter tbEntityTypeId) {
        this.tbEntityTypeId = tbEntityTypeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TBEntityCriteria that = (TBEntityCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(qrCode, that.qrCode) &&
            Objects.equals(name, that.name) &&
            Objects.equals(areaM2, that.areaM2) &&
            Objects.equals(level, that.level) &&
            Objects.equals(status, that.status) &&
            Objects.equals(createdDate, that.createdDate) &&
            Objects.equals(modifiedDate, that.modifiedDate) &&
            Objects.equals(deletedDate, that.deletedDate) &&
            Objects.equals(parentId, that.parentId) &&
            Objects.equals(tbAddressId, that.tbAddressId) &&
            Objects.equals(createdById, that.createdById) &&
            Objects.equals(modifiedById, that.modifiedById) &&
            Objects.equals(deletedById, that.deletedById) &&
            Objects.equals(tbEntityTypeId, that.tbEntityTypeId) &&
            Objects.equals(tbCustomerId, that.tbCustomerId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        qrCode,
        name,
        areaM2,
        level,
        status,
        createdDate,
        modifiedDate,
        deletedDate,
        parentId,
        tbAddressId,
        createdById,
        modifiedById,
        deletedById,
        tbCustomerId,
        tbEntityTypeId
        );
    }

    @Override
    public String toString() {
        return "TBEntityCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (qrCode != null ? "qrCode=" + qrCode + ", " : "") +
                (name != null ? "name=" + name + ", " : "") +
                (areaM2 != null ? "areaM2=" + areaM2 + ", " : "") +
                (level != null ? "level=" + level + ", " : "") +
                (status != null ? "status=" + status + ", " : "") +
                (createdDate != null ? "createdDate=" + createdDate + ", " : "") +
                (modifiedDate != null ? "modifiedDate=" + modifiedDate + ", " : "") +
                (deletedDate != null ? "deletedDate=" + deletedDate + ", " : "") +
                (parentId != null ? "parentId=" + parentId + ", " : "") +
                (tbAddressId != null ? "tbAddressId=" + tbAddressId + ", " : "") +
                (createdById != null ? "createdById=" + createdById + ", " : "") +
                (modifiedById != null ? "modifiedById=" + modifiedById + ", " : "") +
                (deletedById != null ? "deletedById=" + deletedById + ", " : "") +
                (tbCustomerId != null ? "tbCustomerId=" + tbCustomerId + ", " : "") +
                (tbEntityTypeId != null ? "tbEntityTypeId=" + tbEntityTypeId + ", " : "") +
            "}";
    }

}
