package com.emonster.taroaichat.service.criteria;

import com.emonster.taroaichat.domain.enumeration.Feedback;
import com.emonster.taroaichat.domain.enumeration.SessionStatus;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.springdoc.core.annotations.ParameterObject;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.*;

/**
 * Criteria class for the {@link com.emonster.taroaichat.domain.TarotSession} entity. This class is used
 * in {@link com.emonster.taroaichat.web.rest.TarotSessionResource} to receive all the possible filtering options from
 * the Http GET request parameters.
 * For example the following could be a valid request:
 * {@code /tarot-sessions?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
@ParameterObject
@SuppressWarnings("common-java:DuplicatedBlocks")
public class TarotSessionCriteria implements Serializable, Criteria {

    /**
     * Class for filtering SessionStatus
     */
    public static class SessionStatusFilter extends Filter<SessionStatus> {

        public SessionStatusFilter() {}

        public SessionStatusFilter(SessionStatusFilter filter) {
            super(filter);
        }

        @Override
        public SessionStatusFilter copy() {
            return new SessionStatusFilter(this);
        }
    }

    /**
     * Class for filtering Feedback
     */
    public static class FeedbackFilter extends Filter<Feedback> {

        public FeedbackFilter() {}

        public FeedbackFilter(FeedbackFilter filter) {
            super(filter);
        }

        @Override
        public FeedbackFilter copy() {
            return new FeedbackFilter(this);
        }
    }

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private SessionStatusFilter status;

    private FeedbackFilter feedback;

    private IntegerFilter rating;

    private BooleanFilter saved;

    private StringFilter screenshotUrl;

    private InstantFilter completedAt;

    private StringFilter createdBy;

    private InstantFilter createdDate;

    private StringFilter lastModifiedBy;

    private InstantFilter lastModifiedDate;

    private LongFilter chatMessageId;

    private LongFilter userProfileId;

    private Boolean distinct;

    public TarotSessionCriteria() {}

    public TarotSessionCriteria(TarotSessionCriteria other) {
        this.id = other.optionalId().map(LongFilter::copy).orElse(null);
        this.status = other.optionalStatus().map(SessionStatusFilter::copy).orElse(null);
        this.feedback = other.optionalFeedback().map(FeedbackFilter::copy).orElse(null);
        this.rating = other.optionalRating().map(IntegerFilter::copy).orElse(null);
        this.saved = other.optionalSaved().map(BooleanFilter::copy).orElse(null);
        this.screenshotUrl = other.optionalScreenshotUrl().map(StringFilter::copy).orElse(null);
        this.completedAt = other.optionalCompletedAt().map(InstantFilter::copy).orElse(null);
        this.createdBy = other.optionalCreatedBy().map(StringFilter::copy).orElse(null);
        this.createdDate = other.optionalCreatedDate().map(InstantFilter::copy).orElse(null);
        this.lastModifiedBy = other.optionalLastModifiedBy().map(StringFilter::copy).orElse(null);
        this.lastModifiedDate = other.optionalLastModifiedDate().map(InstantFilter::copy).orElse(null);
        this.chatMessageId = other.optionalChatMessageId().map(LongFilter::copy).orElse(null);
        this.userProfileId = other.optionalUserProfileId().map(LongFilter::copy).orElse(null);
        this.distinct = other.distinct;
    }

    @Override
    public TarotSessionCriteria copy() {
        return new TarotSessionCriteria(this);
    }

    public LongFilter getId() {
        return id;
    }

    public Optional<LongFilter> optionalId() {
        return Optional.ofNullable(id);
    }

    public LongFilter id() {
        if (id == null) {
            setId(new LongFilter());
        }
        return id;
    }

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

    public SessionStatusFilter getStatus() {
        return status;
    }

    public Optional<SessionStatusFilter> optionalStatus() {
        return Optional.ofNullable(status);
    }

    public SessionStatusFilter status() {
        if (status == null) {
            setStatus(new SessionStatusFilter());
        }
        return status;
    }

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

    public FeedbackFilter getFeedback() {
        return feedback;
    }

    public Optional<FeedbackFilter> optionalFeedback() {
        return Optional.ofNullable(feedback);
    }

    public FeedbackFilter feedback() {
        if (feedback == null) {
            setFeedback(new FeedbackFilter());
        }
        return feedback;
    }

    public void setFeedback(FeedbackFilter feedback) {
        this.feedback = feedback;
    }

    public IntegerFilter getRating() {
        return rating;
    }

    public Optional<IntegerFilter> optionalRating() {
        return Optional.ofNullable(rating);
    }

    public IntegerFilter rating() {
        if (rating == null) {
            setRating(new IntegerFilter());
        }
        return rating;
    }

    public void setRating(IntegerFilter rating) {
        this.rating = rating;
    }

    public BooleanFilter getSaved() {
        return saved;
    }

    public Optional<BooleanFilter> optionalSaved() {
        return Optional.ofNullable(saved);
    }

    public BooleanFilter saved() {
        if (saved == null) {
            setSaved(new BooleanFilter());
        }
        return saved;
    }

    public void setSaved(BooleanFilter saved) {
        this.saved = saved;
    }

    public StringFilter getScreenshotUrl() {
        return screenshotUrl;
    }

    public Optional<StringFilter> optionalScreenshotUrl() {
        return Optional.ofNullable(screenshotUrl);
    }

    public StringFilter screenshotUrl() {
        if (screenshotUrl == null) {
            setScreenshotUrl(new StringFilter());
        }
        return screenshotUrl;
    }

    public void setScreenshotUrl(StringFilter screenshotUrl) {
        this.screenshotUrl = screenshotUrl;
    }

    public InstantFilter getCompletedAt() {
        return completedAt;
    }

    public Optional<InstantFilter> optionalCompletedAt() {
        return Optional.ofNullable(completedAt);
    }

    public InstantFilter completedAt() {
        if (completedAt == null) {
            setCompletedAt(new InstantFilter());
        }
        return completedAt;
    }

    public void setCompletedAt(InstantFilter completedAt) {
        this.completedAt = completedAt;
    }

    public StringFilter getCreatedBy() {
        return createdBy;
    }

    public Optional<StringFilter> optionalCreatedBy() {
        return Optional.ofNullable(createdBy);
    }

    public StringFilter createdBy() {
        if (createdBy == null) {
            setCreatedBy(new StringFilter());
        }
        return createdBy;
    }

    public void setCreatedBy(StringFilter createdBy) {
        this.createdBy = createdBy;
    }

    public InstantFilter getCreatedDate() {
        return createdDate;
    }

    public Optional<InstantFilter> optionalCreatedDate() {
        return Optional.ofNullable(createdDate);
    }

    public InstantFilter createdDate() {
        if (createdDate == null) {
            setCreatedDate(new InstantFilter());
        }
        return createdDate;
    }

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

    public StringFilter getLastModifiedBy() {
        return lastModifiedBy;
    }

    public Optional<StringFilter> optionalLastModifiedBy() {
        return Optional.ofNullable(lastModifiedBy);
    }

    public StringFilter lastModifiedBy() {
        if (lastModifiedBy == null) {
            setLastModifiedBy(new StringFilter());
        }
        return lastModifiedBy;
    }

    public void setLastModifiedBy(StringFilter lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public InstantFilter getLastModifiedDate() {
        return lastModifiedDate;
    }

    public Optional<InstantFilter> optionalLastModifiedDate() {
        return Optional.ofNullable(lastModifiedDate);
    }

    public InstantFilter lastModifiedDate() {
        if (lastModifiedDate == null) {
            setLastModifiedDate(new InstantFilter());
        }
        return lastModifiedDate;
    }

    public void setLastModifiedDate(InstantFilter lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }

    public LongFilter getChatMessageId() {
        return chatMessageId;
    }

    public Optional<LongFilter> optionalChatMessageId() {
        return Optional.ofNullable(chatMessageId);
    }

    public LongFilter chatMessageId() {
        if (chatMessageId == null) {
            setChatMessageId(new LongFilter());
        }
        return chatMessageId;
    }

    public void setChatMessageId(LongFilter chatMessageId) {
        this.chatMessageId = chatMessageId;
    }

    public LongFilter getUserProfileId() {
        return userProfileId;
    }

    public Optional<LongFilter> optionalUserProfileId() {
        return Optional.ofNullable(userProfileId);
    }

    public LongFilter userProfileId() {
        if (userProfileId == null) {
            setUserProfileId(new LongFilter());
        }
        return userProfileId;
    }

    public void setUserProfileId(LongFilter userProfileId) {
        this.userProfileId = userProfileId;
    }

    public Boolean getDistinct() {
        return distinct;
    }

    public Optional<Boolean> optionalDistinct() {
        return Optional.ofNullable(distinct);
    }

    public Boolean distinct() {
        if (distinct == null) {
            setDistinct(true);
        }
        return distinct;
    }

    public void setDistinct(Boolean distinct) {
        this.distinct = distinct;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final TarotSessionCriteria that = (TarotSessionCriteria) o;
        return (
            Objects.equals(id, that.id) &&
            Objects.equals(status, that.status) &&
            Objects.equals(feedback, that.feedback) &&
            Objects.equals(rating, that.rating) &&
            Objects.equals(saved, that.saved) &&
            Objects.equals(screenshotUrl, that.screenshotUrl) &&
            Objects.equals(completedAt, that.completedAt) &&
            Objects.equals(createdBy, that.createdBy) &&
            Objects.equals(createdDate, that.createdDate) &&
            Objects.equals(lastModifiedBy, that.lastModifiedBy) &&
            Objects.equals(lastModifiedDate, that.lastModifiedDate) &&
            Objects.equals(chatMessageId, that.chatMessageId) &&
            Objects.equals(userProfileId, that.userProfileId) &&
            Objects.equals(distinct, that.distinct)
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            status,
            feedback,
            rating,
            saved,
            screenshotUrl,
            completedAt,
            createdBy,
            createdDate,
            lastModifiedBy,
            lastModifiedDate,
            chatMessageId,
            userProfileId,
            distinct
        );
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "TarotSessionCriteria{" +
            optionalId().map(f -> "id=" + f + ", ").orElse("") +
            optionalStatus().map(f -> "status=" + f + ", ").orElse("") +
            optionalFeedback().map(f -> "feedback=" + f + ", ").orElse("") +
            optionalRating().map(f -> "rating=" + f + ", ").orElse("") +
            optionalSaved().map(f -> "saved=" + f + ", ").orElse("") +
            optionalScreenshotUrl().map(f -> "screenshotUrl=" + f + ", ").orElse("") +
            optionalCompletedAt().map(f -> "completedAt=" + f + ", ").orElse("") +
            optionalCreatedBy().map(f -> "createdBy=" + f + ", ").orElse("") +
            optionalCreatedDate().map(f -> "createdDate=" + f + ", ").orElse("") +
            optionalLastModifiedBy().map(f -> "lastModifiedBy=" + f + ", ").orElse("") +
            optionalLastModifiedDate().map(f -> "lastModifiedDate=" + f + ", ").orElse("") +
            optionalChatMessageId().map(f -> "chatMessageId=" + f + ", ").orElse("") +
            optionalUserProfileId().map(f -> "userProfileId=" + f + ", ").orElse("") +
            optionalDistinct().map(f -> "distinct=" + f + ", ").orElse("") +
        "}";
    }

    private StringFilter userProfilePhone;

    public StringFilter getUserProfilePhone() {
        return userProfilePhone;
    }
    public void setUserProfilePhone(StringFilter userProfilePhone) {
        this.userProfilePhone = userProfilePhone;
    }
}
