software.amazon.awssdk.services.mediaconvert.model.ContainerSettings 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;
/**
* Container specific settings.
*/
@Generated("software.amazon.awssdk:codegen")
public final class ContainerSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CMFC_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("CmfcSettings").getter(getter(ContainerSettings::cmfcSettings)).setter(setter(Builder::cmfcSettings))
.constructor(CmfcSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cmfcSettings").build()).build();
private static final SdkField CONTAINER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Container").getter(getter(ContainerSettings::containerAsString)).setter(setter(Builder::container))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("container").build()).build();
private static final SdkField F4_V_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("F4vSettings").getter(getter(ContainerSettings::f4vSettings)).setter(setter(Builder::f4vSettings))
.constructor(F4vSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("f4vSettings").build()).build();
private static final SdkField M2_TS_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("M2tsSettings").getter(getter(ContainerSettings::m2tsSettings)).setter(setter(Builder::m2tsSettings))
.constructor(M2tsSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("m2tsSettings").build()).build();
private static final SdkField M3_U8_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("M3u8Settings").getter(getter(ContainerSettings::m3u8Settings)).setter(setter(Builder::m3u8Settings))
.constructor(M3u8Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("m3u8Settings").build()).build();
private static final SdkField MOV_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("MovSettings").getter(getter(ContainerSettings::movSettings)).setter(setter(Builder::movSettings))
.constructor(MovSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("movSettings").build()).build();
private static final SdkField MP4_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Mp4Settings").getter(getter(ContainerSettings::mp4Settings)).setter(setter(Builder::mp4Settings))
.constructor(Mp4Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mp4Settings").build()).build();
private static final SdkField MPD_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("MpdSettings").getter(getter(ContainerSettings::mpdSettings)).setter(setter(Builder::mpdSettings))
.constructor(MpdSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mpdSettings").build()).build();
private static final SdkField MXF_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("MxfSettings").getter(getter(ContainerSettings::mxfSettings)).setter(setter(Builder::mxfSettings))
.constructor(MxfSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mxfSettings").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CMFC_SETTINGS_FIELD,
CONTAINER_FIELD, F4_V_SETTINGS_FIELD, M2_TS_SETTINGS_FIELD, M3_U8_SETTINGS_FIELD, MOV_SETTINGS_FIELD,
MP4_SETTINGS_FIELD, MPD_SETTINGS_FIELD, MXF_SETTINGS_FIELD));
private static final long serialVersionUID = 1L;
private final CmfcSettings cmfcSettings;
private final String container;
private final F4vSettings f4vSettings;
private final M2tsSettings m2tsSettings;
private final M3u8Settings m3u8Settings;
private final MovSettings movSettings;
private final Mp4Settings mp4Settings;
private final MpdSettings mpdSettings;
private final MxfSettings mxfSettings;
private ContainerSettings(BuilderImpl builder) {
this.cmfcSettings = builder.cmfcSettings;
this.container = builder.container;
this.f4vSettings = builder.f4vSettings;
this.m2tsSettings = builder.m2tsSettings;
this.m3u8Settings = builder.m3u8Settings;
this.movSettings = builder.movSettings;
this.mp4Settings = builder.mp4Settings;
this.mpdSettings = builder.mpdSettings;
this.mxfSettings = builder.mxfSettings;
}
/**
* These settings relate to the fragmented MP4 container for the segments in your CMAF outputs.
*
* @return These settings relate to the fragmented MP4 container for the segments in your CMAF outputs.
*/
public final CmfcSettings cmfcSettings() {
return cmfcSettings;
}
/**
* Container for this output. Some containers require a container settings object. If not specified, the default
* object will be created.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #container} will
* return {@link ContainerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #containerAsString}.
*
*
* @return Container for this output. Some containers require a container settings object. If not specified, the
* default object will be created.
* @see ContainerType
*/
public final ContainerType container() {
return ContainerType.fromValue(container);
}
/**
* Container for this output. Some containers require a container settings object. If not specified, the default
* object will be created.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #container} will
* return {@link ContainerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #containerAsString}.
*
*
* @return Container for this output. Some containers require a container settings object. If not specified, the
* default object will be created.
* @see ContainerType
*/
public final String containerAsString() {
return container;
}
/**
* Settings for F4v container
*
* @return Settings for F4v container
*/
public final F4vSettings f4vSettings() {
return f4vSettings;
}
/**
* MPEG-2 TS container settings. These apply to outputs in a File output group when the output's container is MPEG-2
* Transport Stream (M2TS). In these assets, data is organized by the program map table (PMT). Each transport stream
* program contains subsets of data, including audio, video, and metadata. Each of these subsets of data has a
* numerical label called a packet identifier (PID). Each transport stream program corresponds to one MediaConvert
* output. The PMT lists the types of data in a program along with their PID. Downstream systems and players use the
* program map table to look up the PID for each type of data it accesses and then uses the PIDs to locate specific
* data within the asset.
*
* @return MPEG-2 TS container settings. These apply to outputs in a File output group when the output's container
* is MPEG-2 Transport Stream (M2TS). In these assets, data is organized by the program map table (PMT).
* Each transport stream program contains subsets of data, including audio, video, and metadata. Each of
* these subsets of data has a numerical label called a packet identifier (PID). Each transport stream
* program corresponds to one MediaConvert output. The PMT lists the types of data in a program along with
* their PID. Downstream systems and players use the program map table to look up the PID for each type of
* data it accesses and then uses the PIDs to locate specific data within the asset.
*/
public final M2tsSettings m2tsSettings() {
return m2tsSettings;
}
/**
* These settings relate to the MPEG-2 transport stream (MPEG2-TS) container for the MPEG2-TS segments in your HLS
* outputs.
*
* @return These settings relate to the MPEG-2 transport stream (MPEG2-TS) container for the MPEG2-TS segments in
* your HLS outputs.
*/
public final M3u8Settings m3u8Settings() {
return m3u8Settings;
}
/**
* These settings relate to your QuickTime MOV output container.
*
* @return These settings relate to your QuickTime MOV output container.
*/
public final MovSettings movSettings() {
return movSettings;
}
/**
* These settings relate to your MP4 output container. You can create audio only outputs with this container. For
* more information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/supported-codecs-containers-audio-only.html
* #output-codecs-and-containers-supported-for-audio-only.
*
* @return These settings relate to your MP4 output container. You can create audio only outputs with this
* container. For more information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/supported-codecs-containers
* -audio-only.html#output-codecs-and-containers-supported-for-audio-only.
*/
public final Mp4Settings mp4Settings() {
return mp4Settings;
}
/**
* These settings relate to the fragmented MP4 container for the segments in your DASH outputs.
*
* @return These settings relate to the fragmented MP4 container for the segments in your DASH outputs.
*/
public final MpdSettings mpdSettings() {
return mpdSettings;
}
/**
* These settings relate to your MXF output container.
*
* @return These settings relate to your MXF output container.
*/
public final MxfSettings mxfSettings() {
return mxfSettings;
}
@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(cmfcSettings());
hashCode = 31 * hashCode + Objects.hashCode(containerAsString());
hashCode = 31 * hashCode + Objects.hashCode(f4vSettings());
hashCode = 31 * hashCode + Objects.hashCode(m2tsSettings());
hashCode = 31 * hashCode + Objects.hashCode(m3u8Settings());
hashCode = 31 * hashCode + Objects.hashCode(movSettings());
hashCode = 31 * hashCode + Objects.hashCode(mp4Settings());
hashCode = 31 * hashCode + Objects.hashCode(mpdSettings());
hashCode = 31 * hashCode + Objects.hashCode(mxfSettings());
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 ContainerSettings)) {
return false;
}
ContainerSettings other = (ContainerSettings) obj;
return Objects.equals(cmfcSettings(), other.cmfcSettings())
&& Objects.equals(containerAsString(), other.containerAsString())
&& Objects.equals(f4vSettings(), other.f4vSettings()) && Objects.equals(m2tsSettings(), other.m2tsSettings())
&& Objects.equals(m3u8Settings(), other.m3u8Settings()) && Objects.equals(movSettings(), other.movSettings())
&& Objects.equals(mp4Settings(), other.mp4Settings()) && Objects.equals(mpdSettings(), other.mpdSettings())
&& Objects.equals(mxfSettings(), other.mxfSettings());
}
/**
* 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("ContainerSettings").add("CmfcSettings", cmfcSettings()).add("Container", containerAsString())
.add("F4vSettings", f4vSettings()).add("M2tsSettings", m2tsSettings()).add("M3u8Settings", m3u8Settings())
.add("MovSettings", movSettings()).add("Mp4Settings", mp4Settings()).add("MpdSettings", mpdSettings())
.add("MxfSettings", mxfSettings()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CmfcSettings":
return Optional.ofNullable(clazz.cast(cmfcSettings()));
case "Container":
return Optional.ofNullable(clazz.cast(containerAsString()));
case "F4vSettings":
return Optional.ofNullable(clazz.cast(f4vSettings()));
case "M2tsSettings":
return Optional.ofNullable(clazz.cast(m2tsSettings()));
case "M3u8Settings":
return Optional.ofNullable(clazz.cast(m3u8Settings()));
case "MovSettings":
return Optional.ofNullable(clazz.cast(movSettings()));
case "Mp4Settings":
return Optional.ofNullable(clazz.cast(mp4Settings()));
case "MpdSettings":
return Optional.ofNullable(clazz.cast(mpdSettings()));
case "MxfSettings":
return Optional.ofNullable(clazz.cast(mxfSettings()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function