package vn.azteam.tpf.service.dto;

import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;

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

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

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    //    private IntegerFilter hasPermission;
    private StringFilter pType;

    private StringFilter v0;

    private StringFilter v1;

    private StringFilter v2;

    private StringFilter v3;

    private StringFilter v4;

    private StringFilter v5;

    private LongFilter createdDate;

    private LongFilter modifiedDate;

    private LongFilter deletedDate;

    private LongFilter tbRoleId;

    private LongFilter tbFunctionId;

    private LongFilter createdById;

    private LongFilter modifiedById;

    private LongFilter deletedById;

    public LongFilter getId() {
        return id;
    }

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

    public StringFilter getpType() {
        return pType;
    }

    public void setpType(StringFilter pType) {
        this.pType = pType;
    }

    public StringFilter getV0() {
        return v0;
    }

    public void setV0(StringFilter v0) {
        this.v0 = v0;
    }

    public StringFilter getV1() {
        return v1;
    }

    public void setV1(StringFilter v1) {
        this.v1 = v1;
    }

    public StringFilter getV2() {
        return v2;
    }

    public void setV2(StringFilter v2) {
        this.v2 = v2;
    }

    public StringFilter getV3() {
        return v3;
    }

    public void setV3(StringFilter v3) {
        this.v3 = v3;
    }

    public StringFilter getV4() {
        return v4;
    }

    public void setV4(StringFilter v4) {
        this.v4 = v4;
    }

    public StringFilter getV5() {
        return v5;
    }

    public void setV5(StringFilter v5) {
        this.v5 = v5;
    }

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

    public LongFilter getCreatedDate() {
        return createdDate;
    }

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

    public LongFilter getModifiedDate() {
        return modifiedDate;
    }

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

    public LongFilter getDeletedDate() {
        return deletedDate;
    }

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

    public LongFilter getTbRoleId() {
        return tbRoleId;
    }

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

    public LongFilter getTbFunctionId() {
        return tbFunctionId;
    }

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

    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 CasbinCriteria that = (CasbinCriteria) o;
        return
            Objects.equals(id, that.id) &&
                Objects.equals(pType, that.pType) &&
                Objects.equals(v0, that.v0) &&
                Objects.equals(v1, that.v1) &&
                Objects.equals(v2, that.v2) &&
                Objects.equals(v3, that.v3) &&
                Objects.equals(v4, that.v4) &&
                Objects.equals(v5, that.v5) &&
//            Objects.equals(hasPermission, that.hasPermission) &&
                Objects.equals(createdDate, that.createdDate) &&
                Objects.equals(modifiedDate, that.modifiedDate) &&
                Objects.equals(deletedDate, that.deletedDate) &&
                Objects.equals(tbRoleId, that.tbRoleId) &&
                Objects.equals(tbFunctionId, that.tbFunctionId) &&
                Objects.equals(createdById, that.createdById) &&
                Objects.equals(modifiedById, that.modifiedById) &&
                Objects.equals(deletedById, that.deletedById);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            pType,
            v0,
            v1,
            v2,
            v3,
            v4,
            v5,
//        hasPermission,
            createdDate,
            modifiedDate,
            deletedDate,
            tbRoleId,
            tbFunctionId,
            createdById,
            modifiedById,
            deletedById
        );
    }

    @Override
    public String toString() {
        return "PermissionCriteria{" +
            (id != null ? "id=" + id + ", " : "") +
            (pType != null ? "id=" + id + ", " : "") +
            (v0 != null ? "v0=" + v0 + ", " : "") +
            (v1 != null ? "v1=" + v1 + ", " : "") +
            (v2 != null ? "v2=" + v2 + ", " : "") +
            (v3 != null ? "v3=" + v3 + ", " : "") +
            (v4 != null ? "v4=" + v4 + ", " : "") +
            (v5 != null ? "v5=" + v5 + ", " : "") +
//                (hasPermission != null ? "hasPermission=" + hasPermission + ", " : "") +
            (createdDate != null ? "createdDate=" + createdDate + ", " : "") +
            (modifiedDate != null ? "modifiedDate=" + modifiedDate + ", " : "") +
            (deletedDate != null ? "deletedDate=" + deletedDate + ", " : "") +
            (tbRoleId != null ? "tbRoleId=" + tbRoleId + ", " : "") +
            (tbFunctionId != null ? "tbFunctionId=" + tbFunctionId + ", " : "") +
            (createdById != null ? "createdById=" + createdById + ", " : "") +
            (modifiedById != null ? "modifiedById=" + modifiedById + ", " : "") +
            (deletedById != null ? "deletedById=" + deletedById + ", " : "") +
            "}";
    }

}
