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

com.amazonaws.services.translate.model.TranslateTextRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Translate module holds the client classes that are used for communicating with Amazon Translate Service

There is a newer version: 1.12.767
Show newest version
/*
 * Copyright 2016-2021 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;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * 
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TranslateTextRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * 

* The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, * this may be fewer than 5,000 characters. *

*/ private String text; /** *

* The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at * most in a TranslateText request. Terminology lists can contain a maximum of 256 terms. *

*/ private java.util.List terminologyNames; /** *

* The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages. *

*

* To have Amazon Translate determine the source language of your text, you can specify auto in the * SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. *

*/ private String sourceLanguageCode; /** *

* The language code requested for the language of the target text. The language must be a language supported by * Amazon Translate. *

*/ private String targetLanguageCode; /** *

* The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, * this may be fewer than 5,000 characters. *

* * @param text * The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character * set, this may be fewer than 5,000 characters. */ public void setText(String text) { this.text = text; } /** *

* The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, * this may be fewer than 5,000 characters. *

* * @return The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character * set, this may be fewer than 5,000 characters. */ public String getText() { return this.text; } /** *

* The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, * this may be fewer than 5,000 characters. *

* * @param text * The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character * set, this may be fewer than 5,000 characters. * @return Returns a reference to this object so that method calls can be chained together. */ public TranslateTextRequest withText(String text) { setText(text); return this; } /** *

* The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at * most in a TranslateText request. Terminology lists can contain a maximum of 256 terms. *

* * @return The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology * list at most in a TranslateText request. Terminology lists can contain a maximum of 256 * terms. */ public java.util.List getTerminologyNames() { return terminologyNames; } /** *

* The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at * most in a TranslateText request. Terminology lists can contain a maximum of 256 terms. *

* * @param terminologyNames * The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology * list at most in a TranslateText request. Terminology lists can contain a maximum of 256 * terms. */ public void setTerminologyNames(java.util.Collection terminologyNames) { if (terminologyNames == null) { this.terminologyNames = null; return; } this.terminologyNames = new java.util.ArrayList(terminologyNames); } /** *

* The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at * most in a TranslateText request. Terminology lists can contain a maximum of 256 terms. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTerminologyNames(java.util.Collection)} or {@link #withTerminologyNames(java.util.Collection)} if you * want to override the existing values. *

* * @param terminologyNames * The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology * list at most in a TranslateText request. Terminology lists can contain a maximum of 256 * terms. * @return Returns a reference to this object so that method calls can be chained together. */ public TranslateTextRequest withTerminologyNames(String... terminologyNames) { if (this.terminologyNames == null) { setTerminologyNames(new java.util.ArrayList(terminologyNames.length)); } for (String ele : terminologyNames) { this.terminologyNames.add(ele); } return this; } /** *

* The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at * most in a TranslateText request. Terminology lists can contain a maximum of 256 terms. *

* * @param terminologyNames * The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology * list at most in a TranslateText request. Terminology lists can contain a maximum of 256 * terms. * @return Returns a reference to this object so that method calls can be chained together. */ public TranslateTextRequest withTerminologyNames(java.util.Collection terminologyNames) { setTerminologyNames(terminologyNames); return this; } /** *

* The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages. *

*

* To have Amazon Translate determine the source language of your text, you can specify auto in the * SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. *

* * @param sourceLanguageCode * The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages.

*

* To have Amazon Translate determine the source language of your text, you can specify auto in * the SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. */ public void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; } /** *

* The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages. *

*

* To have Amazon Translate determine the source language of your text, you can specify auto in the * SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. *

* * @return The language code for the language of the source text. The language must be a language supported by * Amazon Translate. For a list of language codes, see what-is-languages.

*

* To have Amazon Translate determine the source language of your text, you can specify auto in * the SourceLanguageCode field. If you specify auto, Amazon Translate will call * Amazon Comprehend * to determine the source language. */ public String getSourceLanguageCode() { return this.sourceLanguageCode; } /** *

* The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages. *

*

* To have Amazon Translate determine the source language of your text, you can specify auto in the * SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. *

* * @param sourceLanguageCode * The language code for the language of the source text. The language must be a language supported by Amazon * Translate. For a list of language codes, see what-is-languages.

*

* To have Amazon Translate determine the source language of your text, you can specify auto in * the SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to * determine the source language. * @return Returns a reference to this object so that method calls can be chained together. */ public TranslateTextRequest withSourceLanguageCode(String sourceLanguageCode) { setSourceLanguageCode(sourceLanguageCode); return this; } /** *

* The language code requested for the language of the target text. The language must be a language supported by * Amazon Translate. *

* * @param targetLanguageCode * The language code requested for the language of the target text. The language must be a language supported * by Amazon Translate. */ public void setTargetLanguageCode(String targetLanguageCode) { this.targetLanguageCode = targetLanguageCode; } /** *

* The language code requested for the language of the target text. The language must be a language supported by * Amazon Translate. *

* * @return The language code requested for the language of the target text. The language must be a language * supported by Amazon Translate. */ public String getTargetLanguageCode() { return this.targetLanguageCode; } /** *

* The language code requested for the language of the target text. The language must be a language supported by * Amazon Translate. *

* * @param targetLanguageCode * The language code requested for the language of the target text. The language must be a language supported * by Amazon Translate. * @return Returns a reference to this object so that method calls can be chained together. */ public TranslateTextRequest withTargetLanguageCode(String targetLanguageCode) { setTargetLanguageCode(targetLanguageCode); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getText() != null) sb.append("Text: ").append(getText()).append(","); if (getTerminologyNames() != null) sb.append("TerminologyNames: ").append(getTerminologyNames()).append(","); if (getSourceLanguageCode() != null) sb.append("SourceLanguageCode: ").append(getSourceLanguageCode()).append(","); if (getTargetLanguageCode() != null) sb.append("TargetLanguageCode: ").append(getTargetLanguageCode()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TranslateTextRequest == false) return false; TranslateTextRequest other = (TranslateTextRequest) obj; if (other.getText() == null ^ this.getText() == null) return false; if (other.getText() != null && other.getText().equals(this.getText()) == false) return false; if (other.getTerminologyNames() == null ^ this.getTerminologyNames() == null) return false; if (other.getTerminologyNames() != null && other.getTerminologyNames().equals(this.getTerminologyNames()) == 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; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode()); hashCode = prime * hashCode + ((getTerminologyNames() == null) ? 0 : getTerminologyNames().hashCode()); hashCode = prime * hashCode + ((getSourceLanguageCode() == null) ? 0 : getSourceLanguageCode().hashCode()); hashCode = prime * hashCode + ((getTargetLanguageCode() == null) ? 0 : getTargetLanguageCode().hashCode()); return hashCode; } @Override public TranslateTextRequest clone() { return (TranslateTextRequest) super.clone(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy