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

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter name;

    private StringFilter typeRequest;

    private StringFilter path;

    private StringFilter method;

    private LongFilter tbFunctionGroupId;

    public LongFilter getId() {
        return id;
    }

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

    public StringFilter getName() {
        return name;
    }

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

    public StringFilter getTypeRequest() {
        return typeRequest;
    }

    public void setTypeRequest(StringFilter typeRequest) {
        this.typeRequest = typeRequest;
    }

    public StringFilter getPath() {
        return path;
    }

    public void setPath(StringFilter path) {
        this.path = path;
    }

    public StringFilter getMethod() {
        return method;
    }

    public void setMethod(StringFilter method) {
        this.method = method;
    }

    public LongFilter getTbFunctionGroupId() {
        return tbFunctionGroupId;
    }

    public void setTbFunctionGroupId(LongFilter tbFunctionGroupId) {
        this.tbFunctionGroupId = tbFunctionGroupId;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TBFunctionCriteria that = (TBFunctionCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(name, that.name) &&
            Objects.equals(typeRequest, that.typeRequest) &&
            Objects.equals(path, that.path) &&
            Objects.equals(method, that.method) &&
            Objects.equals(tbFunctionGroupId, that.tbFunctionGroupId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        name,
        typeRequest,
        path,
        method,
        tbFunctionGroupId
        );
    }

    @Override
    public String toString() {
        return "TBFunctionCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (name != null ? "name=" + name + ", " : "") +
                (typeRequest != null ? "typeRequest=" + typeRequest + ", " : "") +
                (path != null ? "path=" + path + ", " : "") +
                (method != null ? "method=" + method + ", " : "") +
                (tbFunctionGroupId != null ? "tbFunctionGroupId=" + tbFunctionGroupId + ", " : "") +
            "}";
    }

}
