Class TranslationSettings

java.lang.Object
software.amazon.awssdk.services.translate.model.TranslationSettings
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<TranslationSettings.Builder,TranslationSettings>

@Generated("software.amazon.awssdk:codegen") public final class TranslationSettings extends Object implements SdkPojo, Serializable, ToCopyableBuilder<TranslationSettings.Builder,TranslationSettings>

Settings to configure your translation output. You can configure the following options:

  • Brevity: reduces the length of the translation output for most translations. Available for TranslateText only.

  • Formality: sets the formality level of the translation output.

  • Profanity: masks profane words and phrases in the translation output.

See Also:
  • Method Details

    • formality

      public final Formality formality()

      You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.

      If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.

      For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.

      If the service returns an enum value that is not available in the current SDK version, formality will return Formality.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from formalityAsString().

      Returns:
      You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.

      If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.

      For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.

      See Also:
    • formalityAsString

      public final String formalityAsString()

      You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.

      If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.

      For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.

      If the service returns an enum value that is not available in the current SDK version, formality will return Formality.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from formalityAsString().

      Returns:
      You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.

      If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.

      For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.

      See Also:
    • profanity

      public final Profanity profanity()

      You can enable the profanity setting if you want to mask profane words and phrases in your translation output.

      To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.

      Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.

      If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.

      If the service returns an enum value that is not available in the current SDK version, profanity will return Profanity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from profanityAsString().

      Returns:
      You can enable the profanity setting if you want to mask profane words and phrases in your translation output.

      To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.

      Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.

      If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.

      See Also:
    • profanityAsString

      public final String profanityAsString()

      You can enable the profanity setting if you want to mask profane words and phrases in your translation output.

      To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.

      Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.

      If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.

      If the service returns an enum value that is not available in the current SDK version, profanity will return Profanity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from profanityAsString().

      Returns:
      You can enable the profanity setting if you want to mask profane words and phrases in your translation output.

      To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.

      Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.

      If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.

      See Also:
    • brevity

      public final Brevity brevity()

      When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.

      If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.

      For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.

      If the service returns an enum value that is not available in the current SDK version, brevity will return Brevity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from brevityAsString().

      Returns:
      When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.

      If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.

      For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.

      See Also:
    • brevityAsString

      public final String brevityAsString()

      When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.

      If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.

      For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.

      If the service returns an enum value that is not available in the current SDK version, brevity will return Brevity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from brevityAsString().

      Returns:
      When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.

      If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.

      For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.

      See Also:
    • toBuilder

      public TranslationSettings.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<TranslationSettings.Builder,TranslationSettings>
      Returns:
      a builder for type T
    • builder

      public static TranslationSettings.Builder builder()
    • serializableBuilderClass

      public static Class<? extends TranslationSettings.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.