/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk.models.operations;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;


public class Similar {

    /**
     * The unique similar item identifier.
     */
    @JsonProperty("id")
    private long id;

    /**
     * The filter string for similar items.
     */
    @JsonProperty("filter")
    private String filter;

    /**
     * The tag or title of the similar content.
     */
    @JsonProperty("tag")
    private String tag;

    @JsonCreator
    public Similar(
            @JsonProperty("id") long id,
            @JsonProperty("filter") String filter,
            @JsonProperty("tag") String tag) {
        Utils.checkNotNull(id, "id");
        Utils.checkNotNull(filter, "filter");
        Utils.checkNotNull(tag, "tag");
        this.id = id;
        this.filter = filter;
        this.tag = tag;
    }

    /**
     * The unique similar item identifier.
     */
    @JsonIgnore
    public long id() {
        return id;
    }

    /**
     * The filter string for similar items.
     */
    @JsonIgnore
    public String filter() {
        return filter;
    }

    /**
     * The tag or title of the similar content.
     */
    @JsonIgnore
    public String tag() {
        return tag;
    }

    public final static Builder builder() {
        return new Builder();
    }

    /**
     * The unique similar item identifier.
     */
    public Similar withId(long id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

    /**
     * The filter string for similar items.
     */
    public Similar withFilter(String filter) {
        Utils.checkNotNull(filter, "filter");
        this.filter = filter;
        return this;
    }

    /**
     * The tag or title of the similar content.
     */
    public Similar withTag(String tag) {
        Utils.checkNotNull(tag, "tag");
        this.tag = tag;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Similar other = (Similar) o;
        return 
            Objects.deepEquals(this.id, other.id) &&
            Objects.deepEquals(this.filter, other.filter) &&
            Objects.deepEquals(this.tag, other.tag);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            filter,
            tag);
    }
    
    @Override
    public String toString() {
        return Utils.toString(Similar.class,
                "id", id,
                "filter", filter,
                "tag", tag);
    }
    
    public final static class Builder {
 
        private Long id;
 
        private String filter;
 
        private String tag;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * The unique similar item identifier.
         */
        public Builder id(long id) {
            Utils.checkNotNull(id, "id");
            this.id = id;
            return this;
        }

        /**
         * The filter string for similar items.
         */
        public Builder filter(String filter) {
            Utils.checkNotNull(filter, "filter");
            this.filter = filter;
            return this;
        }

        /**
         * The tag or title of the similar content.
         */
        public Builder tag(String tag) {
            Utils.checkNotNull(tag, "tag");
            this.tag = tag;
            return this;
        }
        
        public Similar build() {
            return new Similar(
                id,
                filter,
                tag);
        }
    }
}

