/* * 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 TranslateDocumentResult implements Serializable { /** *
* The document containing the translated content. The document format * matches the source document format. *
*/ private TranslatedDocument translatedDocument; /** ** The language code of the source document. *
*
* Constraints:
* Length: 2 - 5
*/
private String sourceLanguageCode;
/**
*
* The language code of the translated document. *
*
* Constraints:
* Length: 2 - 5
*/
private String targetLanguageCode;
/**
*
* The names of the custom terminologies applied to the input text by Amazon * Translate to produce the translated text document. *
*/ private java.util.List* Settings to configure your translation output, including the option to * set the formality level of the output text and the option to mask profane * words and phrases. *
*/ private TranslationSettings appliedSettings; /** ** The document containing the translated content. The document format * matches the source document format. *
* * @return* The document containing the translated content. The document * format matches the source document format. *
*/ public TranslatedDocument getTranslatedDocument() { return translatedDocument; } /** ** The document containing the translated content. The document format * matches the source document format. *
* * @param translatedDocument* The document containing the translated content. The document * format matches the source document format. *
*/ public void setTranslatedDocument(TranslatedDocument translatedDocument) { this.translatedDocument = translatedDocument; } /** ** The document containing the translated content. The document format * matches the source document format. *
** Returns a reference to this object so that method calls can be chained * together. * * @param translatedDocument
* The document containing the translated content. The document * format matches the source document format. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult withTranslatedDocument(TranslatedDocument translatedDocument) { this.translatedDocument = translatedDocument; return this; } /** ** The language code of the source document. *
*
* Constraints:
* Length: 2 - 5
*
* @return
* The language code of the source document. *
*/ public String getSourceLanguageCode() { return sourceLanguageCode; } /** ** The language code of the source document. *
*
* Constraints:
* Length: 2 - 5
*
* @param sourceLanguageCode
* The language code of the source document. *
*/ public void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; } /** ** The language code of the source document. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 2 - 5
*
* @param sourceLanguageCode
* The language code of the source document. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult withSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; return this; } /** ** The language code of the translated document. *
*
* Constraints:
* Length: 2 - 5
*
* @return
* The language code of the translated document. *
*/ public String getTargetLanguageCode() { return targetLanguageCode; } /** ** The language code of the translated document. *
*
* Constraints:
* Length: 2 - 5
*
* @param targetLanguageCode
* The language code of the translated document. *
*/ public void setTargetLanguageCode(String targetLanguageCode) { this.targetLanguageCode = targetLanguageCode; } /** ** The language code of the translated document. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 2 - 5
*
* @param targetLanguageCode
* The language code of the translated document. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult withTargetLanguageCode(String targetLanguageCode) { this.targetLanguageCode = targetLanguageCode; return this; } /** ** The names of the custom terminologies applied to the input text by Amazon * Translate to produce the translated text document. *
* * @return* The names of the custom terminologies applied to the input text * by Amazon Translate to produce the translated text document. *
*/ public java.util.List* The names of the custom terminologies applied to the input text by Amazon * Translate to produce the translated text document. *
* * @param appliedTerminologies* The names of the custom terminologies applied to the input * text by Amazon Translate to produce the translated text * document. *
*/ public void setAppliedTerminologies( java.util.Collection* The names of the custom terminologies applied to the input text by Amazon * Translate to produce the translated text document. *
** 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 to produce the translated text * document. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult 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 to produce the translated text document. *
** 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 to produce the translated text * document. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult withAppliedTerminologies( java.util.Collection* Settings to configure your translation output, including the option to * set the formality level of the output text and the option to mask profane * words and phrases. *
* * @return* Settings to configure your translation output, including the * option to set the formality level of the output text and the * option to mask profane words and phrases. *
*/ public TranslationSettings getAppliedSettings() { return appliedSettings; } /** ** Settings to configure your translation output, including the option to * set the formality level of the output text and the option to mask profane * words and phrases. *
* * @param appliedSettings* Settings to configure your translation output, including the * option to set the formality level of the output text and the * option to mask profane words and phrases. *
*/ public void setAppliedSettings(TranslationSettings appliedSettings) { this.appliedSettings = appliedSettings; } /** ** Settings to configure your translation output, including the option to * set the formality level of the output text and the option to mask profane * words and phrases. *
** Returns a reference to this object so that method calls can be chained * together. * * @param appliedSettings
* Settings to configure your translation output, including the * option to set the formality level of the output text and the * option to mask profane words and phrases. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TranslateDocumentResult 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 (getTranslatedDocument() != null) sb.append("TranslatedDocument: " + getTranslatedDocument() + ","); 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 + ((getTranslatedDocument() == null) ? 0 : getTranslatedDocument().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 TranslateDocumentResult == false) return false; TranslateDocumentResult other = (TranslateDocumentResult) obj; if (other.getTranslatedDocument() == null ^ this.getTranslatedDocument() == null) return false; if (other.getTranslatedDocument() != null && other.getTranslatedDocument().equals(this.getTranslatedDocument()) == 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; } }