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

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private IntegerFilter hasPermission;

    private InstantFilter createdDate;

    private InstantFilter modifiedDate;

    private InstantFilter deletedDate;

    private LongFilter tbFunctionId;

    private LongFilter tbRoleId;

    private LongFilter createdById;

    private LongFilter modifiedById;

    private LongFilter deletedById;

    public LongFilter getId() {
        return id;
    }

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

    public IntegerFilter getHasPermission() {
        return hasPermission;
    }

    public void setHasPermission(IntegerFilter hasPermission) {
        this.hasPermission = hasPermission;
    }

    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 getTbFunctionId() {
        return tbFunctionId;
    }

    public void setTbFunctionId(LongFilter tbFunctionId) {
        this.tbFunctionId = tbFunctionId;
    }

    public LongFilter getTbRoleId() {
        return tbRoleId;
    }

    public void setTbRoleId(LongFilter tbRoleId) {
        this.tbRoleId = tbRoleId;
    }

    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;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TBPermissionCriteria that = (TBPermissionCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(hasPermission, that.hasPermission) &&
            Objects.equals(createdDate, that.createdDate) &&
            Objects.equals(modifiedDate, that.modifiedDate) &&
            Objects.equals(deletedDate, that.deletedDate) &&
            Objects.equals(tbFunctionId, that.tbFunctionId) &&
            Objects.equals(tbRoleId, that.tbRoleId) &&
            Objects.equals(createdById, that.createdById) &&
            Objects.equals(modifiedById, that.modifiedById) &&
            Objects.equals(deletedById, that.deletedById);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        hasPermission,
        createdDate,
        modifiedDate,
        deletedDate,
        tbFunctionId,
        tbRoleId,
        createdById,
        modifiedById,
        deletedById
        );
    }

    @Override
    public String toString() {
        return "TBPermissionCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (hasPermission != null ? "hasPermission=" + hasPermission + ", " : "") +
                (createdDate != null ? "createdDate=" + createdDate + ", " : "") +
                (modifiedDate != null ? "modifiedDate=" + modifiedDate + ", " : "") +
                (deletedDate != null ? "deletedDate=" + deletedDate + ", " : "") +
                (tbFunctionId != null ? "tbFunctionId=" + tbFunctionId + ", " : "") +
                (tbRoleId != null ? "tbRoleId=" + tbRoleId + ", " : "") +
                (createdById != null ? "createdById=" + createdById + ", " : "") +
                (modifiedById != null ? "modifiedById=" + modifiedById + ", " : "") +
                (deletedById != null ? "deletedById=" + deletedById + ", " : "") +
            "}";
    }

}
