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

com.rapidapi.p.wordsapiv1.models.WordResponse Maven / Gradle / Ivy

/*
 * WordsAPILib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

package com.rapidapi.p.wordsapiv1.models;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.apimatic.core.types.OptionalNullable;
import java.util.List;

/**
 * This is a model class for WordResponse type.
 */
public class WordResponse {
    private OptionalNullable word;
    private OptionalNullable> results;
    private OptionalNullable pronunciation;
    private OptionalNullable frequency;
    private SyllableDetails syllables;

    /**
     * Default constructor.
     */
    public WordResponse() {
    }

    /**
     * Initialization constructor.
     * @param  word  String value for word.
     * @param  results  List of WordDetails value for results.
     * @param  pronunciation  Object value for pronunciation.
     * @param  frequency  Double value for frequency.
     * @param  syllables  SyllableDetails value for syllables.
     */
    public WordResponse(
            String word,
            List results,
            Object pronunciation,
            Double frequency,
            SyllableDetails syllables) {
        this.word = OptionalNullable.of(word);
        this.results = OptionalNullable.of(results);
        this.pronunciation = OptionalNullable.of(pronunciation);
        this.frequency = OptionalNullable.of(frequency);
        this.syllables = syllables;
    }

    /**
     * Initialization constructor.
     * @param  word  String value for word.
     * @param  results  List of WordDetails value for results.
     * @param  pronunciation  Object value for pronunciation.
     * @param  frequency  Double value for frequency.
     * @param  syllables  SyllableDetails value for syllables.
     */

    protected WordResponse(OptionalNullable word,
            OptionalNullable> results, OptionalNullable pronunciation,
            OptionalNullable frequency, SyllableDetails syllables) {
        this.word = word;
        this.results = results;
        this.pronunciation = pronunciation;
        this.frequency = frequency;
        this.syllables = syllables;
    }

    /**
     * Internal Getter for Word.
     * The word that is searched.
     * @return Returns the Internal String
     */
    @JsonGetter("word")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetWord() {
        return this.word;
    }

    /**
     * Getter for Word.
     * The word that is searched.
     * @return Returns the String
     */
    public String getWord() {
        return OptionalNullable.getFrom(word);
    }

    /**
     * Setter for Word.
     * The word that is searched.
     * @param word Value for String
     */
    @JsonSetter("word")
    public void setWord(String word) {
        this.word = OptionalNullable.of(word);
    }

    /**
     * UnSetter for Word.
     * The word that is searched.
     */
    public void unsetWord() {
        word = null;
    }

    /**
     * Internal Getter for Results.
     * This field contains detailed information of the word.
     * @return Returns the Internal List of WordDetails
     */
    @JsonGetter("results")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable> internalGetResults() {
        return this.results;
    }

    /**
     * Getter for Results.
     * This field contains detailed information of the word.
     * @return Returns the List of WordDetails
     */
    public List getResults() {
        return OptionalNullable.getFrom(results);
    }

    /**
     * Setter for Results.
     * This field contains detailed information of the word.
     * @param results Value for List of WordDetails
     */
    @JsonSetter("results")
    public void setResults(List results) {
        this.results = OptionalNullable.of(results);
    }

    /**
     * UnSetter for Results.
     * This field contains detailed information of the word.
     */
    public void unsetResults() {
        results = null;
    }

    /**
     * Internal Getter for Pronunciation.
     * This model contains pronunciation details of a specific word.
     * @return Returns the Internal Object
     */
    @JsonGetter("pronunciation")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetPronunciation() {
        return this.pronunciation;
    }

    /**
     * Getter for Pronunciation.
     * This model contains pronunciation details of a specific word.
     * @return Returns the Object
     */
    public Object getPronunciation() {
        return OptionalNullable.getFrom(pronunciation);
    }

    /**
     * Setter for Pronunciation.
     * This model contains pronunciation details of a specific word.
     * @param pronunciation Value for Object
     */
    @JsonSetter("pronunciation")
    public void setPronunciation(Object pronunciation) {
        this.pronunciation = OptionalNullable.of(pronunciation);
    }

    /**
     * UnSetter for Pronunciation.
     * This model contains pronunciation details of a specific word.
     */
    public void unsetPronunciation() {
        pronunciation = null;
    }

    /**
     * Internal Getter for Frequency.
     * The frequency of the word usage.
     * @return Returns the Internal Double
     */
    @JsonGetter("frequency")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetFrequency() {
        return this.frequency;
    }

    /**
     * Getter for Frequency.
     * The frequency of the word usage.
     * @return Returns the Double
     */
    public Double getFrequency() {
        return OptionalNullable.getFrom(frequency);
    }

    /**
     * Setter for Frequency.
     * The frequency of the word usage.
     * @param frequency Value for Double
     */
    @JsonSetter("frequency")
    public void setFrequency(Double frequency) {
        this.frequency = OptionalNullable.of(frequency);
    }

    /**
     * UnSetter for Frequency.
     * The frequency of the word usage.
     */
    public void unsetFrequency() {
        frequency = null;
    }

    /**
     * Getter for Syllables.
     * This custom type contains the syllable details for word API.
     * @return Returns the SyllableDetails
     */
    @JsonGetter("syllables")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public SyllableDetails getSyllables() {
        return syllables;
    }

    /**
     * Setter for Syllables.
     * This custom type contains the syllable details for word API.
     * @param syllables Value for SyllableDetails
     */
    @JsonSetter("syllables")
    public void setSyllables(SyllableDetails syllables) {
        this.syllables = syllables;
    }

    /**
     * Converts this WordResponse into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "WordResponse [" + "word=" + word + ", results=" + results + ", pronunciation="
                + pronunciation + ", frequency=" + frequency + ", syllables=" + syllables + "]";
    }

    /**
     * Builds a new {@link WordResponse.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link WordResponse.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder()
                .syllables(getSyllables());
        builder.word = internalGetWord();
        builder.results = internalGetResults();
        builder.pronunciation = internalGetPronunciation();
        builder.frequency = internalGetFrequency();
        return builder;
    }

    /**
     * Class to build instances of {@link WordResponse}.
     */
    public static class Builder {
        private OptionalNullable word;
        private OptionalNullable> results;
        private OptionalNullable pronunciation;
        private OptionalNullable frequency;
        private SyllableDetails syllables;



        /**
         * Setter for word.
         * @param  word  String value for word.
         * @return Builder
         */
        public Builder word(String word) {
            this.word = OptionalNullable.of(word);
            return this;
        }

        /**
         * UnSetter for word.
         * @return Builder
         */
        public Builder unsetWord() {
            word = null;
            return this;
        }

        /**
         * Setter for results.
         * @param  results  List of WordDetails value for results.
         * @return Builder
         */
        public Builder results(List results) {
            this.results = OptionalNullable.of(results);
            return this;
        }

        /**
         * UnSetter for results.
         * @return Builder
         */
        public Builder unsetResults() {
            results = null;
            return this;
        }

        /**
         * Setter for pronunciation.
         * @param  pronunciation  Object value for pronunciation.
         * @return Builder
         */
        public Builder pronunciation(Object pronunciation) {
            this.pronunciation = OptionalNullable.of(pronunciation);
            return this;
        }

        /**
         * UnSetter for pronunciation.
         * @return Builder
         */
        public Builder unsetPronunciation() {
            pronunciation = null;
            return this;
        }

        /**
         * Setter for frequency.
         * @param  frequency  Double value for frequency.
         * @return Builder
         */
        public Builder frequency(Double frequency) {
            this.frequency = OptionalNullable.of(frequency);
            return this;
        }

        /**
         * UnSetter for frequency.
         * @return Builder
         */
        public Builder unsetFrequency() {
            frequency = null;
            return this;
        }

        /**
         * Setter for syllables.
         * @param  syllables  SyllableDetails value for syllables.
         * @return Builder
         */
        public Builder syllables(SyllableDetails syllables) {
            this.syllables = syllables;
            return this;
        }

        /**
         * Builds a new {@link WordResponse} object using the set fields.
         * @return {@link WordResponse}
         */
        public WordResponse build() {
            return new WordResponse(word, results, pronunciation, frequency, syllables);
        }
    }
}