/* * 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; /** *
* The properties of the custom terminology. *
*/ public class TerminologyProperties implements Serializable { /** ** The name of the custom terminology. *
*
* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
*/
private String name;
/**
*
* The description of the custom terminology properties. *
*
* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
*/
private String description;
/**
*
* The Amazon Resource Name (ARN) of the custom terminology. *
*
* Constraints:
* Length: 1 - 512
*/
private String arn;
/**
*
* The language code for the source text of the translation request for * which the custom terminology is being used. *
*
* Constraints:
* Length: 2 - 5
*/
private String sourceLanguageCode;
/**
*
* The language codes for the target languages available with the custom * terminology resource. All possible target languages are returned in * array. *
*/ private java.util.List* The encryption key for the custom terminology. *
*/ private EncryptionKey encryptionKey; /** ** The size of the file used when importing a custom terminology. *
*/ private Integer sizeBytes; /** ** The number of terms included in the custom terminology. *
*/ private Integer termCount; /** ** The time at which the custom terminology was created, based on the * timestamp. *
*/ private java.util.Date createdAt; /** ** The time at which the custom terminology was last update, based on the * timestamp. *
*/ private java.util.Date lastUpdatedAt; /** ** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
*
* Constraints:
* Allowed Values: UNI, MULTI
*/
private String directionality;
/**
*
* Additional information from Amazon Translate about the terminology * resource. *
*/ private String message; /** ** The number of terms in the input file that Amazon Translate skipped when * you created or updated the terminology resource. *
*/ private Integer skippedTermCount; /** ** The format of the custom terminology input file. *
*
* Constraints:
* Allowed Values: CSV, TMX, TSV
*/
private String format;
/**
*
* The name of the custom terminology. *
*
* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
*
* @return
* The name of the custom terminology. *
*/ public String getName() { return name; } /** ** The name of the custom terminology. *
*
* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
*
* @param name
* The name of the custom terminology. *
*/ public void setName(String name) { this.name = name; } /** ** The name of the custom terminology. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
*
* @param name
* The name of the custom terminology. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withName(String name) { this.name = name; return this; } /** ** The description of the custom terminology properties. *
*
* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
*
* @return
* The description of the custom terminology properties. *
*/ public String getDescription() { return description; } /** ** The description of the custom terminology properties. *
*
* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
*
* @param description
* The description of the custom terminology properties. *
*/ public void setDescription(String description) { this.description = description; } /** ** The description of the custom terminology properties. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
*
* @param description
* The description of the custom terminology properties. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withDescription(String description) { this.description = description; return this; } /** ** The Amazon Resource Name (ARN) of the custom terminology. *
*
* Constraints:
* Length: 1 - 512
*
* @return
* The Amazon Resource Name (ARN) of the custom terminology. *
*/ public String getArn() { return arn; } /** ** The Amazon Resource Name (ARN) of the custom terminology. *
*
* Constraints:
* Length: 1 - 512
*
* @param arn
* The Amazon Resource Name (ARN) of the custom terminology. *
*/ public void setArn(String arn) { this.arn = arn; } /** ** The Amazon Resource Name (ARN) of the custom terminology. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 512
*
* @param arn
* The Amazon Resource Name (ARN) of the custom terminology. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withArn(String arn) { this.arn = arn; return this; } /** ** The language code for the source text of the translation request for * which the custom terminology is being used. *
*
* Constraints:
* Length: 2 - 5
*
* @return
* The language code for the source text of the translation request * for which the custom terminology is being used. *
*/ public String getSourceLanguageCode() { return sourceLanguageCode; } /** ** The language code for the source text of the translation request for * which the custom terminology is being used. *
*
* Constraints:
* Length: 2 - 5
*
* @param sourceLanguageCode
* The language code for the source text of the translation * request for which the custom terminology is being used. *
*/ public void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; } /** ** The language code for the source text of the translation request for * which the custom terminology is being used. *
** 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 source text of the translation * request for which the custom terminology is being used. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; return this; } /** ** The language codes for the target languages available with the custom * terminology resource. All possible target languages are returned in * array. *
* * @return* The language codes for the target languages available with the * custom terminology resource. All possible target languages are * returned in array. *
*/ public java.util.List* The language codes for the target languages available with the custom * terminology resource. All possible target languages are returned in * array. *
* * @param targetLanguageCodes* The language codes for the target languages available with the * custom terminology resource. All possible target languages are * returned in array. *
*/ public void setTargetLanguageCodes(java.util.Collection* The language codes for the target languages available with the custom * terminology resource. All possible target languages are returned in * array. *
** Returns a reference to this object so that method calls can be chained * together. * * @param targetLanguageCodes
* The language codes for the target languages available with the * custom terminology resource. All possible target languages are * returned in array. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withTargetLanguageCodes(String... targetLanguageCodes) { if (getTargetLanguageCodes() == null) { this.targetLanguageCodes = new java.util.ArrayList* The language codes for the target languages available with the custom * terminology resource. All possible target languages are returned in * array. *
** Returns a reference to this object so that method calls can be chained * together. * * @param targetLanguageCodes
* The language codes for the target languages available with the * custom terminology resource. All possible target languages are * returned in array. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withTargetLanguageCodes( java.util.Collection* The encryption key for the custom terminology. *
* * @return* The encryption key for the custom terminology. *
*/ public EncryptionKey getEncryptionKey() { return encryptionKey; } /** ** The encryption key for the custom terminology. *
* * @param encryptionKey* The encryption key for the custom terminology. *
*/ public void setEncryptionKey(EncryptionKey encryptionKey) { this.encryptionKey = encryptionKey; } /** ** The encryption key for the custom terminology. *
** Returns a reference to this object so that method calls can be chained * together. * * @param encryptionKey
* The encryption key for the custom terminology. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withEncryptionKey(EncryptionKey encryptionKey) { this.encryptionKey = encryptionKey; return this; } /** ** The size of the file used when importing a custom terminology. *
* * @return* The size of the file used when importing a custom terminology. *
*/ public Integer getSizeBytes() { return sizeBytes; } /** ** The size of the file used when importing a custom terminology. *
* * @param sizeBytes* The size of the file used when importing a custom terminology. *
*/ public void setSizeBytes(Integer sizeBytes) { this.sizeBytes = sizeBytes; } /** ** The size of the file used when importing a custom terminology. *
** Returns a reference to this object so that method calls can be chained * together. * * @param sizeBytes
* The size of the file used when importing a custom terminology. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withSizeBytes(Integer sizeBytes) { this.sizeBytes = sizeBytes; return this; } /** ** The number of terms included in the custom terminology. *
* * @return* The number of terms included in the custom terminology. *
*/ public Integer getTermCount() { return termCount; } /** ** The number of terms included in the custom terminology. *
* * @param termCount* The number of terms included in the custom terminology. *
*/ public void setTermCount(Integer termCount) { this.termCount = termCount; } /** ** The number of terms included in the custom terminology. *
** Returns a reference to this object so that method calls can be chained * together. * * @param termCount
* The number of terms included in the custom terminology. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withTermCount(Integer termCount) { this.termCount = termCount; return this; } /** ** The time at which the custom terminology was created, based on the * timestamp. *
* * @return* The time at which the custom terminology was created, based on * the timestamp. *
*/ public java.util.Date getCreatedAt() { return createdAt; } /** ** The time at which the custom terminology was created, based on the * timestamp. *
* * @param createdAt* The time at which the custom terminology was created, based on * the timestamp. *
*/ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** ** The time at which the custom terminology was created, based on the * timestamp. *
** Returns a reference to this object so that method calls can be chained * together. * * @param createdAt
* The time at which the custom terminology was created, based on * the timestamp. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; return this; } /** ** The time at which the custom terminology was last update, based on the * timestamp. *
* * @return* The time at which the custom terminology was last update, based * on the timestamp. *
*/ public java.util.Date getLastUpdatedAt() { return lastUpdatedAt; } /** ** The time at which the custom terminology was last update, based on the * timestamp. *
* * @param lastUpdatedAt* The time at which the custom terminology was last update, * based on the timestamp. *
*/ public void setLastUpdatedAt(java.util.Date lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; } /** ** The time at which the custom terminology was last update, based on the * timestamp. *
** Returns a reference to this object so that method calls can be chained * together. * * @param lastUpdatedAt
* The time at which the custom terminology was last update, * based on the timestamp. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withLastUpdatedAt(java.util.Date lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; return this; } /** ** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
*
* Constraints:
* Allowed Values: UNI, MULTI
*
* @return
* The directionality of your terminology resource indicates whether * it has one source language (uni-directional) or multiple * (multi-directional). *
** The terminology resource has one source language (the first * column in a CSV file), and all of its other languages are target * languages. *
** Any language in the terminology resource can be the source * language. *
** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
*
* Constraints:
* Allowed Values: UNI, MULTI
*
* @param directionality
* The directionality of your terminology resource indicates * whether it has one source language (uni-directional) or * multiple (multi-directional). *
** The terminology resource has one source language (the first * column in a CSV file), and all of its other languages are * target languages. *
** Any language in the terminology resource can be the source * language. *
** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: UNI, MULTI
*
* @param directionality
* The directionality of your terminology resource indicates * whether it has one source language (uni-directional) or * multiple (multi-directional). *
** The terminology resource has one source language (the first * column in a CSV file), and all of its other languages are * target languages. *
** Any language in the terminology resource can be the source * language. *
** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
*
* Constraints:
* Allowed Values: UNI, MULTI
*
* @param directionality
* The directionality of your terminology resource indicates * whether it has one source language (uni-directional) or * multiple (multi-directional). *
** The terminology resource has one source language (the first * column in a CSV file), and all of its other languages are * target languages. *
** Any language in the terminology resource can be the source * language. *
** The directionality of your terminology resource indicates whether it has * one source language (uni-directional) or multiple (multi-directional). *
** The terminology resource has one source language (the first column in a * CSV file), and all of its other languages are target languages. *
** Any language in the terminology resource can be the source language. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: UNI, MULTI
*
* @param directionality
* The directionality of your terminology resource indicates * whether it has one source language (uni-directional) or * multiple (multi-directional). *
** The terminology resource has one source language (the first * column in a CSV file), and all of its other languages are * target languages. *
** Any language in the terminology resource can be the source * language. *
** Additional information from Amazon Translate about the terminology * resource. *
* * @return* Additional information from Amazon Translate about the * terminology resource. *
*/ public String getMessage() { return message; } /** ** Additional information from Amazon Translate about the terminology * resource. *
* * @param message* Additional information from Amazon Translate about the * terminology resource. *
*/ public void setMessage(String message) { this.message = message; } /** ** Additional information from Amazon Translate about the terminology * resource. *
** Returns a reference to this object so that method calls can be chained * together. * * @param message
* Additional information from Amazon Translate about the * terminology resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withMessage(String message) { this.message = message; return this; } /** ** The number of terms in the input file that Amazon Translate skipped when * you created or updated the terminology resource. *
* * @return* The number of terms in the input file that Amazon Translate * skipped when you created or updated the terminology resource. *
*/ public Integer getSkippedTermCount() { return skippedTermCount; } /** ** The number of terms in the input file that Amazon Translate skipped when * you created or updated the terminology resource. *
* * @param skippedTermCount* The number of terms in the input file that Amazon Translate * skipped when you created or updated the terminology resource. *
*/ public void setSkippedTermCount(Integer skippedTermCount) { this.skippedTermCount = skippedTermCount; } /** ** The number of terms in the input file that Amazon Translate skipped when * you created or updated the terminology resource. *
** Returns a reference to this object so that method calls can be chained * together. * * @param skippedTermCount
* The number of terms in the input file that Amazon Translate * skipped when you created or updated the terminology resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TerminologyProperties withSkippedTermCount(Integer skippedTermCount) { this.skippedTermCount = skippedTermCount; return this; } /** ** The format of the custom terminology input file. *
*
* Constraints:
* Allowed Values: CSV, TMX, TSV
*
* @return
* The format of the custom terminology input file. *
* @see TerminologyDataFormat */ public String getFormat() { return format; } /** ** The format of the custom terminology input file. *
*
* Constraints:
* Allowed Values: CSV, TMX, TSV
*
* @param format
* The format of the custom terminology input file. *
* @see TerminologyDataFormat */ public void setFormat(String format) { this.format = format; } /** ** The format of the custom terminology input file. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CSV, TMX, TSV
*
* @param format
* The format of the custom terminology input file. *
* @return A reference to this updated object so that method calls can be * chained together. * @see TerminologyDataFormat */ public TerminologyProperties withFormat(String format) { this.format = format; return this; } /** ** The format of the custom terminology input file. *
*
* Constraints:
* Allowed Values: CSV, TMX, TSV
*
* @param format
* The format of the custom terminology input file. *
* @see TerminologyDataFormat */ public void setFormat(TerminologyDataFormat format) { this.format = format.toString(); } /** ** The format of the custom terminology input file. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CSV, TMX, TSV
*
* @param format
* The format of the custom terminology input file. *
* @return A reference to this updated object so that method calls can be * chained together. * @see TerminologyDataFormat */ public TerminologyProperties withFormat(TerminologyDataFormat format) { this.format = format.toString(); 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 (getName() != null) sb.append("Name: " + getName() + ","); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getArn() != null) sb.append("Arn: " + getArn() + ","); if (getSourceLanguageCode() != null) sb.append("SourceLanguageCode: " + getSourceLanguageCode() + ","); if (getTargetLanguageCodes() != null) sb.append("TargetLanguageCodes: " + getTargetLanguageCodes() + ","); if (getEncryptionKey() != null) sb.append("EncryptionKey: " + getEncryptionKey() + ","); if (getSizeBytes() != null) sb.append("SizeBytes: " + getSizeBytes() + ","); if (getTermCount() != null) sb.append("TermCount: " + getTermCount() + ","); if (getCreatedAt() != null) sb.append("CreatedAt: " + getCreatedAt() + ","); if (getLastUpdatedAt() != null) sb.append("LastUpdatedAt: " + getLastUpdatedAt() + ","); if (getDirectionality() != null) sb.append("Directionality: " + getDirectionality() + ","); if (getMessage() != null) sb.append("Message: " + getMessage() + ","); if (getSkippedTermCount() != null) sb.append("SkippedTermCount: " + getSkippedTermCount() + ","); if (getFormat() != null) sb.append("Format: " + getFormat()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getSourceLanguageCode() == null) ? 0 : getSourceLanguageCode().hashCode()); hashCode = prime * hashCode + ((getTargetLanguageCodes() == null) ? 0 : getTargetLanguageCodes().hashCode()); hashCode = prime * hashCode + ((getEncryptionKey() == null) ? 0 : getEncryptionKey().hashCode()); hashCode = prime * hashCode + ((getSizeBytes() == null) ? 0 : getSizeBytes().hashCode()); hashCode = prime * hashCode + ((getTermCount() == null) ? 0 : getTermCount().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode()); hashCode = prime * hashCode + ((getDirectionality() == null) ? 0 : getDirectionality().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getSkippedTermCount() == null) ? 0 : getSkippedTermCount().hashCode()); hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TerminologyProperties == false) return false; TerminologyProperties other = (TerminologyProperties) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == 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.getTargetLanguageCodes() == null ^ this.getTargetLanguageCodes() == null) return false; if (other.getTargetLanguageCodes() != null && other.getTargetLanguageCodes().equals(this.getTargetLanguageCodes()) == false) return false; if (other.getEncryptionKey() == null ^ this.getEncryptionKey() == null) return false; if (other.getEncryptionKey() != null && other.getEncryptionKey().equals(this.getEncryptionKey()) == false) return false; if (other.getSizeBytes() == null ^ this.getSizeBytes() == null) return false; if (other.getSizeBytes() != null && other.getSizeBytes().equals(this.getSizeBytes()) == false) return false; if (other.getTermCount() == null ^ this.getTermCount() == null) return false; if (other.getTermCount() != null && other.getTermCount().equals(this.getTermCount()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == null) return false; if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == false) return false; if (other.getDirectionality() == null ^ this.getDirectionality() == null) return false; if (other.getDirectionality() != null && other.getDirectionality().equals(this.getDirectionality()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getSkippedTermCount() == null ^ this.getSkippedTermCount() == null) return false; if (other.getSkippedTermCount() != null && other.getSkippedTermCount().equals(this.getSkippedTermCount()) == false) return false; if (other.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; return true; } }