com.rapidapi.p.wordsapiv1.models.FrequencyResponse 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;
/**
* This is a model class for FrequencyResponse type.
*/
public class FrequencyResponse {
private OptionalNullable word;
private FrequencyDetails frequency;
/**
* Default constructor.
*/
public FrequencyResponse() {
}
/**
* Initialization constructor.
* @param word String value for word.
* @param frequency FrequencyDetails value for frequency.
*/
public FrequencyResponse(
String word,
FrequencyDetails frequency) {
this.word = OptionalNullable.of(word);
this.frequency = frequency;
}
/**
* Initialization constructor.
* @param word String value for word.
* @param frequency FrequencyDetails value for frequency.
*/
protected FrequencyResponse(OptionalNullable word, FrequencyDetails frequency) {
this.word = word;
this.frequency = frequency;
}
/**
* 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;
}
/**
* Getter for Frequency.
* This model contains frequency details of a specific word.
* @return Returns the FrequencyDetails
*/
@JsonGetter("frequency")
@JsonInclude(JsonInclude.Include.NON_NULL)
public FrequencyDetails getFrequency() {
return frequency;
}
/**
* Setter for Frequency.
* This model contains frequency details of a specific word.
* @param frequency Value for FrequencyDetails
*/
@JsonSetter("frequency")
public void setFrequency(FrequencyDetails frequency) {
this.frequency = frequency;
}
/**
* Converts this FrequencyResponse into string format.
* @return String representation of this class
*/
@Override
public String toString() {
return "FrequencyResponse [" + "word=" + word + ", frequency=" + frequency + "]";
}
/**
* Builds a new {@link FrequencyResponse.Builder} object.
* Creates the instance with the state of the current model.
* @return a new {@link FrequencyResponse.Builder} object
*/
public Builder toBuilder() {
Builder builder = new Builder()
.frequency(getFrequency());
builder.word = internalGetWord();
return builder;
}
/**
* Class to build instances of {@link FrequencyResponse}.
*/
public static class Builder {
private OptionalNullable word;
private FrequencyDetails frequency;
/**
* 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 frequency.
* @param frequency FrequencyDetails value for frequency.
* @return Builder
*/
public Builder frequency(FrequencyDetails frequency) {
this.frequency = frequency;
return this;
}
/**
* Builds a new {@link FrequencyResponse} object using the set fields.
* @return {@link FrequencyResponse}
*/
public FrequencyResponse build() {
return new FrequencyResponse(word, frequency);
}
}
}