All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.basistech.rosette.apimodel.SimilarTermsOptions Maven / Gradle / Ivy

The newest version!
// Generated by delombok at Fri Nov 15 11:56:46 CST 2024
/*
 * Copyright 2023 Basis Technology Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.basistech.rosette.apimodel;

import com.basistech.rosette.annotations.JacksonMixin;
import com.basistech.util.LanguageCode;
import java.util.List;

/**
 * Similar terms options
 */
@JacksonMixin
public final class SimilarTermsOptions extends Options {
    /**
     * The List of languages to find similar terms in
     */
    private final List resultLanguages;
    /**
     * The number of similar terms to return for each specified language
     */
    private final Integer count;
    /**
     */
    private final EmbeddingsMode embeddingsMode;

    @SuppressWarnings("all")
    SimilarTermsOptions(final List resultLanguages, final Integer count, final EmbeddingsMode embeddingsMode) {
        this.resultLanguages = resultLanguages;
        this.count = count;
        this.embeddingsMode = embeddingsMode;
    }


    @SuppressWarnings("all")
    public static class SimilarTermsOptionsBuilder {
        @SuppressWarnings("all")
        private List resultLanguages;
        @SuppressWarnings("all")
        private Integer count;
        @SuppressWarnings("all")
        private EmbeddingsMode embeddingsMode;

        @SuppressWarnings("all")
        SimilarTermsOptionsBuilder() {
        }

        /**
         * The List of languages to find similar terms in
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public SimilarTermsOptions.SimilarTermsOptionsBuilder resultLanguages(final List resultLanguages) {
            this.resultLanguages = resultLanguages;
            return this;
        }

        /**
         * The number of similar terms to return for each specified language
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public SimilarTermsOptions.SimilarTermsOptionsBuilder count(final Integer count) {
            this.count = count;
            return this;
        }

        /**
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public SimilarTermsOptions.SimilarTermsOptionsBuilder embeddingsMode(final EmbeddingsMode embeddingsMode) {
            this.embeddingsMode = embeddingsMode;
            return this;
        }

        @SuppressWarnings("all")
        public SimilarTermsOptions build() {
            return new SimilarTermsOptions(this.resultLanguages, this.count, this.embeddingsMode);
        }

        @Override
        @SuppressWarnings("all")
        public String toString() {
            return "SimilarTermsOptions.SimilarTermsOptionsBuilder(resultLanguages=" + this.resultLanguages + ", count=" + this.count + ", embeddingsMode=" + this.embeddingsMode + ")";
        }
    }

    @SuppressWarnings("all")
    public static SimilarTermsOptions.SimilarTermsOptionsBuilder builder() {
        return new SimilarTermsOptions.SimilarTermsOptionsBuilder();
    }

    /**
     * The List of languages to find similar terms in
     * @return the list of specified result languages
     */
    @SuppressWarnings("all")
    public List getResultLanguages() {
        return this.resultLanguages;
    }

    /**
     * The number of similar terms to return for each specified language
     * @return the number of similar terms requested
     */
    @SuppressWarnings("all")
    public Integer getCount() {
        return this.count;
    }

    /**
     * @return the generation of embeddings to use for all languages, defaulting to second generation embeddings unless
     * the language supports first generation embeddings
     */
    @SuppressWarnings("all")
    public EmbeddingsMode getEmbeddingsMode() {
        return this.embeddingsMode;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof SimilarTermsOptions)) return false;
        final SimilarTermsOptions other = (SimilarTermsOptions) o;
        if (!other.canEqual((Object) this)) return false;
        if (!super.equals(o)) return false;
        final Object this$count = this.getCount();
        final Object other$count = other.getCount();
        if (this$count == null ? other$count != null : !this$count.equals(other$count)) return false;
        final Object this$resultLanguages = this.getResultLanguages();
        final Object other$resultLanguages = other.getResultLanguages();
        if (this$resultLanguages == null ? other$resultLanguages != null : !this$resultLanguages.equals(other$resultLanguages)) return false;
        final Object this$embeddingsMode = this.getEmbeddingsMode();
        final Object other$embeddingsMode = other.getEmbeddingsMode();
        if (this$embeddingsMode == null ? other$embeddingsMode != null : !this$embeddingsMode.equals(other$embeddingsMode)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof SimilarTermsOptions;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final Object $count = this.getCount();
        result = result * PRIME + ($count == null ? 43 : $count.hashCode());
        final Object $resultLanguages = this.getResultLanguages();
        result = result * PRIME + ($resultLanguages == null ? 43 : $resultLanguages.hashCode());
        final Object $embeddingsMode = this.getEmbeddingsMode();
        result = result * PRIME + ($embeddingsMode == null ? 43 : $embeddingsMode.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "SimilarTermsOptions(resultLanguages=" + this.getResultLanguages() + ", count=" + this.getCount() + ", embeddingsMode=" + this.getEmbeddingsMode() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy