software.amazon.awssdk.services.mediaconvert.model.CaptionDescription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mediaconvert Show documentation
Show all versions of mediaconvert Show documentation
The AWS Java SDK for AWS Elemental MediaConvert module holds the client classes that are used for
communicating
with AWS Elemental MediaConvert Service
/*
* Copyright 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 software.amazon.awssdk.services.mediaconvert.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* This object holds groups of settings related to captions for one output. For each output that has captions, include
* one instance of CaptionDescriptions.
*/
@Generated("software.amazon.awssdk:codegen")
public final class CaptionDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CAPTION_SELECTOR_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CaptionSelectorName").getter(getter(CaptionDescription::captionSelectorName))
.setter(setter(Builder::captionSelectorName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("captionSelectorName").build())
.build();
private static final SdkField CUSTOM_LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomLanguageCode").getter(getter(CaptionDescription::customLanguageCode))
.setter(setter(Builder::customLanguageCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customLanguageCode").build())
.build();
private static final SdkField DESTINATION_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DestinationSettings")
.getter(getter(CaptionDescription::destinationSettings)).setter(setter(Builder::destinationSettings))
.constructor(CaptionDestinationSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destinationSettings").build())
.build();
private static final SdkField LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LanguageCode").getter(getter(CaptionDescription::languageCodeAsString))
.setter(setter(Builder::languageCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("languageCode").build()).build();
private static final SdkField LANGUAGE_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LanguageDescription").getter(getter(CaptionDescription::languageDescription))
.setter(setter(Builder::languageDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("languageDescription").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CAPTION_SELECTOR_NAME_FIELD,
CUSTOM_LANGUAGE_CODE_FIELD, DESTINATION_SETTINGS_FIELD, LANGUAGE_CODE_FIELD, LANGUAGE_DESCRIPTION_FIELD));
private static final long serialVersionUID = 1L;
private final String captionSelectorName;
private final String customLanguageCode;
private final CaptionDestinationSettings destinationSettings;
private final String languageCode;
private final String languageDescription;
private CaptionDescription(BuilderImpl builder) {
this.captionSelectorName = builder.captionSelectorName;
this.customLanguageCode = builder.customLanguageCode;
this.destinationSettings = builder.destinationSettings;
this.languageCode = builder.languageCode;
this.languageDescription = builder.languageDescription;
}
/**
* Specifies which "Caption Selector":#inputs-caption_selector to use from each input when generating captions. The
* name should be of the format "Caption Selector ", which denotes that the Nth Caption Selector will be used
* from each input.
*
* @return Specifies which "Caption Selector":#inputs-caption_selector to use from each input when generating
* captions. The name should be of the format "Caption Selector ", which denotes that the Nth Caption
* Selector will be used from each input.
*/
public final String captionSelectorName() {
return captionSelectorName;
}
/**
* Specify the language for this captions output track. For most captions output formats, the encoder puts this
* language information in the output captions metadata. If your output captions format is DVB-Sub or Burn in, the
* encoder uses this language information when automatically selecting the font script for rendering the captions
* text. For all outputs, you can use an ISO 639-2 or ISO 639-3 code. For streaming outputs, you can also use any
* other code in the full RFC-5646 specification. Streaming outputs are those that are in one of the following
* output groups: CMAF, DASH ISO, Apple HLS, or Microsoft Smooth Streaming.
*
* @return Specify the language for this captions output track. For most captions output formats, the encoder puts
* this language information in the output captions metadata. If your output captions format is DVB-Sub or
* Burn in, the encoder uses this language information when automatically selecting the font script for
* rendering the captions text. For all outputs, you can use an ISO 639-2 or ISO 639-3 code. For streaming
* outputs, you can also use any other code in the full RFC-5646 specification. Streaming outputs are those
* that are in one of the following output groups: CMAF, DASH ISO, Apple HLS, or Microsoft Smooth Streaming.
*/
public final String customLanguageCode() {
return customLanguageCode;
}
/**
* Settings related to one captions tab on the MediaConvert console. Usually, one captions tab corresponds to one
* output captions track. Depending on your output captions format, one tab might correspond to a set of output
* captions tracks. For more information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/including-captions.html.
*
* @return Settings related to one captions tab on the MediaConvert console. Usually, one captions tab corresponds
* to one output captions track. Depending on your output captions format, one tab might correspond to a set
* of output captions tracks. For more information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/including-captions.html.
*/
public final CaptionDestinationSettings destinationSettings() {
return destinationSettings;
}
/**
* Specify the language of this captions output track. For most captions output formats, the encoder puts this
* language information in the output captions metadata. If your output captions format is DVB-Sub or Burn in, the
* encoder uses this language information to choose the font language for rendering the captions text.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #languageCode} will
* return {@link LanguageCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #languageCodeAsString}.
*
*
* @return Specify the language of this captions output track. For most captions output formats, the encoder puts
* this language information in the output captions metadata. If your output captions format is DVB-Sub or
* Burn in, the encoder uses this language information to choose the font language for rendering the
* captions text.
* @see LanguageCode
*/
public final LanguageCode languageCode() {
return LanguageCode.fromValue(languageCode);
}
/**
* Specify the language of this captions output track. For most captions output formats, the encoder puts this
* language information in the output captions metadata. If your output captions format is DVB-Sub or Burn in, the
* encoder uses this language information to choose the font language for rendering the captions text.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #languageCode} will
* return {@link LanguageCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #languageCodeAsString}.
*
*
* @return Specify the language of this captions output track. For most captions output formats, the encoder puts
* this language information in the output captions metadata. If your output captions format is DVB-Sub or
* Burn in, the encoder uses this language information to choose the font language for rendering the
* captions text.
* @see LanguageCode
*/
public final String languageCodeAsString() {
return languageCode;
}
/**
* Specify a label for this set of output captions. For example, "English", "Director commentary", or "track_2". For
* streaming outputs, MediaConvert passes this information into destination manifests for display on the
* end-viewer's player device. For outputs in other output groups, the service ignores this setting.
*
* @return Specify a label for this set of output captions. For example, "English", "Director commentary", or
* "track_2". For streaming outputs, MediaConvert passes this information into destination manifests for
* display on the end-viewer's player device. For outputs in other output groups, the service ignores this
* setting.
*/
public final String languageDescription() {
return languageDescription;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(captionSelectorName());
hashCode = 31 * hashCode + Objects.hashCode(customLanguageCode());
hashCode = 31 * hashCode + Objects.hashCode(destinationSettings());
hashCode = 31 * hashCode + Objects.hashCode(languageCodeAsString());
hashCode = 31 * hashCode + Objects.hashCode(languageDescription());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CaptionDescription)) {
return false;
}
CaptionDescription other = (CaptionDescription) obj;
return Objects.equals(captionSelectorName(), other.captionSelectorName())
&& Objects.equals(customLanguageCode(), other.customLanguageCode())
&& Objects.equals(destinationSettings(), other.destinationSettings())
&& Objects.equals(languageCodeAsString(), other.languageCodeAsString())
&& Objects.equals(languageDescription(), other.languageDescription());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("CaptionDescription").add("CaptionSelectorName", captionSelectorName())
.add("CustomLanguageCode", customLanguageCode()).add("DestinationSettings", destinationSettings())
.add("LanguageCode", languageCodeAsString()).add("LanguageDescription", languageDescription()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CaptionSelectorName":
return Optional.ofNullable(clazz.cast(captionSelectorName()));
case "CustomLanguageCode":
return Optional.ofNullable(clazz.cast(customLanguageCode()));
case "DestinationSettings":
return Optional.ofNullable(clazz.cast(destinationSettings()));
case "LanguageCode":
return Optional.ofNullable(clazz.cast(languageCodeAsString()));
case "LanguageDescription":
return Optional.ofNullable(clazz.cast(languageDescription()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function