/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.translate.model; import java.io.Serializable; public class TranslateTextResult implements Serializable { /** *
* The translated text. *
*
* Constraints:
* Length: - 20000
* Pattern: [\P{M}\p{M}]{0,20000}
*/
private String translatedText;
/**
*
* The language code for the language of the source text. *
*
* Constraints:
* Length: 2 - 5
*/
private String sourceLanguageCode;
/**
*
* The language code for the language of the target text. *
*
* Constraints:
* Length: 2 - 5
*/
private String targetLanguageCode;
/**
*
* The names of the custom terminologies applied to the input text by Amazon * Translate for the translated text response. *
*/ private java.util.List* Optional settings that modify the translation output. *
*/ private TranslationSettings appliedSettings; /** ** The translated text. *
*
* Constraints:
* Length: - 20000
* Pattern: [\P{M}\p{M}]{0,20000}
*
* @return
* The translated text. *
*/ public String getTranslatedText() { return translatedText; } /** ** The translated text. *
*
* Constraints:
* Length: - 20000
* Pattern: [\P{M}\p{M}]{0,20000}
*
* @param translatedText
* The translated text. *
*/ public void setTranslatedText(String translatedText) { this.translatedText = translatedText; } /** ** The translated text. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 20000
* Pattern: [\P{M}\p{M}]{0,20000}
*
* @param translatedText
* The translated text. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withTranslatedText(String translatedText) { this.translatedText = translatedText; return this; } /** ** The language code for the language of the source text. *
*
* Constraints:
* Length: 2 - 5
*
* @return
* The language code for the language of the source text. *
*/ public String getSourceLanguageCode() { return sourceLanguageCode; } /** ** The language code for the language of the source text. *
*
* Constraints:
* Length: 2 - 5
*
* @param sourceLanguageCode
* The language code for the language of the source text. *
*/ public void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; } /** ** The language code for the language of the source text. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 2 - 5
*
* @param sourceLanguageCode
* The language code for the language of the source text. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; return this; } /** ** The language code for the language of the target text. *
*
* Constraints:
* Length: 2 - 5
*
* @return
* The language code for the language of the target text. *
*/ public String getTargetLanguageCode() { return targetLanguageCode; } /** ** The language code for the language of the target text. *
*
* Constraints:
* Length: 2 - 5
*
* @param targetLanguageCode
* The language code for the language of the target text. *
*/ public void setTargetLanguageCode(String targetLanguageCode) { this.targetLanguageCode = targetLanguageCode; } /** ** The language code for the language of the target text. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 2 - 5
*
* @param targetLanguageCode
* The language code for the language of the target text. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withTargetLanguageCode(String targetLanguageCode) { this.targetLanguageCode = targetLanguageCode; return this; } /** ** The names of the custom terminologies applied to the input text by Amazon * Translate for the translated text response. *
* * @return* The names of the custom terminologies applied to the input text * by Amazon Translate for the translated text response. *
*/ public java.util.List* The names of the custom terminologies applied to the input text by Amazon * Translate for the translated text response. *
* * @param appliedTerminologies* The names of the custom terminologies applied to the input * text by Amazon Translate for the translated text response. *
*/ public void setAppliedTerminologies( java.util.Collection* The names of the custom terminologies applied to the input text by Amazon * Translate for the translated text response. *
** Returns a reference to this object so that method calls can be chained * together. * * @param appliedTerminologies
* The names of the custom terminologies applied to the input * text by Amazon Translate for the translated text response. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withAppliedTerminologies(AppliedTerminology... appliedTerminologies) { if (getAppliedTerminologies() == null) { this.appliedTerminologies = new java.util.ArrayList* The names of the custom terminologies applied to the input text by Amazon * Translate for the translated text response. *
** Returns a reference to this object so that method calls can be chained * together. * * @param appliedTerminologies
* The names of the custom terminologies applied to the input * text by Amazon Translate for the translated text response. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withAppliedTerminologies( java.util.Collection* Optional settings that modify the translation output. *
* * @return* Optional settings that modify the translation output. *
*/ public TranslationSettings getAppliedSettings() { return appliedSettings; } /** ** Optional settings that modify the translation output. *
* * @param appliedSettings* Optional settings that modify the translation output. *
*/ public void setAppliedSettings(TranslationSettings appliedSettings) { this.appliedSettings = appliedSettings; } /** ** Optional settings that modify the translation output. *
** Returns a reference to this object so that method calls can be chained * together. * * @param appliedSettings
* Optional settings that modify the translation output. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateTextResult withAppliedSettings(TranslationSettings appliedSettings) { this.appliedSettings = appliedSettings; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTranslatedText() != null) sb.append("TranslatedText: " + getTranslatedText() + ","); if (getSourceLanguageCode() != null) sb.append("SourceLanguageCode: " + getSourceLanguageCode() + ","); if (getTargetLanguageCode() != null) sb.append("TargetLanguageCode: " + getTargetLanguageCode() + ","); if (getAppliedTerminologies() != null) sb.append("AppliedTerminologies: " + getAppliedTerminologies() + ","); if (getAppliedSettings() != null) sb.append("AppliedSettings: " + getAppliedSettings()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTranslatedText() == null) ? 0 : getTranslatedText().hashCode()); hashCode = prime * hashCode + ((getSourceLanguageCode() == null) ? 0 : getSourceLanguageCode().hashCode()); hashCode = prime * hashCode + ((getTargetLanguageCode() == null) ? 0 : getTargetLanguageCode().hashCode()); hashCode = prime * hashCode + ((getAppliedTerminologies() == null) ? 0 : getAppliedTerminologies().hashCode()); hashCode = prime * hashCode + ((getAppliedSettings() == null) ? 0 : getAppliedSettings().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TranslateTextResult == false) return false; TranslateTextResult other = (TranslateTextResult) obj; if (other.getTranslatedText() == null ^ this.getTranslatedText() == null) return false; if (other.getTranslatedText() != null && other.getTranslatedText().equals(this.getTranslatedText()) == false) return false; if (other.getSourceLanguageCode() == null ^ this.getSourceLanguageCode() == null) return false; if (other.getSourceLanguageCode() != null && other.getSourceLanguageCode().equals(this.getSourceLanguageCode()) == false) return false; if (other.getTargetLanguageCode() == null ^ this.getTargetLanguageCode() == null) return false; if (other.getTargetLanguageCode() != null && other.getTargetLanguageCode().equals(this.getTargetLanguageCode()) == false) return false; if (other.getAppliedTerminologies() == null ^ this.getAppliedTerminologies() == null) return false; if (other.getAppliedTerminologies() != null && other.getAppliedTerminologies().equals(this.getAppliedTerminologies()) == false) return false; if (other.getAppliedSettings() == null ^ this.getAppliedSettings() == null) return false; if (other.getAppliedSettings() != null && other.getAppliedSettings().equals(this.getAppliedSettings()) == false) return false; return true; } }