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

software.amazon.awssdk.services.medialive.model.AudioCodecSettings Maven / Gradle / Ivy

/*
 * 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.medialive.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;

/**
 * Audio Codec Settings
 */
@Generated("software.amazon.awssdk:codegen")
public final class AudioCodecSettings implements SdkPojo, Serializable,
        ToCopyableBuilder {
    private static final SdkField AAC_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("AacSettings").getter(getter(AudioCodecSettings::aacSettings)).setter(setter(Builder::aacSettings))
            .constructor(AacSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("aacSettings").build()).build();

    private static final SdkField AC3_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("Ac3Settings").getter(getter(AudioCodecSettings::ac3Settings)).setter(setter(Builder::ac3Settings))
            .constructor(Ac3Settings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ac3Settings").build()).build();

    private static final SdkField EAC3_ATMOS_SETTINGS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("Eac3AtmosSettings")
            .getter(getter(AudioCodecSettings::eac3AtmosSettings)).setter(setter(Builder::eac3AtmosSettings))
            .constructor(Eac3AtmosSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eac3AtmosSettings").build()).build();

    private static final SdkField EAC3_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("Eac3Settings").getter(getter(AudioCodecSettings::eac3Settings)).setter(setter(Builder::eac3Settings))
            .constructor(Eac3Settings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eac3Settings").build()).build();

    private static final SdkField MP2_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("Mp2Settings").getter(getter(AudioCodecSettings::mp2Settings)).setter(setter(Builder::mp2Settings))
            .constructor(Mp2Settings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mp2Settings").build()).build();

    private static final SdkField PASS_THROUGH_SETTINGS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("PassThroughSettings")
            .getter(getter(AudioCodecSettings::passThroughSettings)).setter(setter(Builder::passThroughSettings))
            .constructor(PassThroughSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("passThroughSettings").build())
            .build();

    private static final SdkField WAV_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("WavSettings").getter(getter(AudioCodecSettings::wavSettings)).setter(setter(Builder::wavSettings))
            .constructor(WavSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("wavSettings").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AAC_SETTINGS_FIELD,
            AC3_SETTINGS_FIELD, EAC3_ATMOS_SETTINGS_FIELD, EAC3_SETTINGS_FIELD, MP2_SETTINGS_FIELD, PASS_THROUGH_SETTINGS_FIELD,
            WAV_SETTINGS_FIELD));

    private static final long serialVersionUID = 1L;

    private final AacSettings aacSettings;

    private final Ac3Settings ac3Settings;

    private final Eac3AtmosSettings eac3AtmosSettings;

    private final Eac3Settings eac3Settings;

    private final Mp2Settings mp2Settings;

    private final PassThroughSettings passThroughSettings;

    private final WavSettings wavSettings;

    private AudioCodecSettings(BuilderImpl builder) {
        this.aacSettings = builder.aacSettings;
        this.ac3Settings = builder.ac3Settings;
        this.eac3AtmosSettings = builder.eac3AtmosSettings;
        this.eac3Settings = builder.eac3Settings;
        this.mp2Settings = builder.mp2Settings;
        this.passThroughSettings = builder.passThroughSettings;
        this.wavSettings = builder.wavSettings;
    }

    /**
     * Returns the value of the AacSettings property for this object.
     * 
     * @return The value of the AacSettings property for this object.
     */
    public final AacSettings aacSettings() {
        return aacSettings;
    }

    /**
     * Returns the value of the Ac3Settings property for this object.
     * 
     * @return The value of the Ac3Settings property for this object.
     */
    public final Ac3Settings ac3Settings() {
        return ac3Settings;
    }

    /**
     * Returns the value of the Eac3AtmosSettings property for this object.
     * 
     * @return The value of the Eac3AtmosSettings property for this object.
     */
    public final Eac3AtmosSettings eac3AtmosSettings() {
        return eac3AtmosSettings;
    }

    /**
     * Returns the value of the Eac3Settings property for this object.
     * 
     * @return The value of the Eac3Settings property for this object.
     */
    public final Eac3Settings eac3Settings() {
        return eac3Settings;
    }

    /**
     * Returns the value of the Mp2Settings property for this object.
     * 
     * @return The value of the Mp2Settings property for this object.
     */
    public final Mp2Settings mp2Settings() {
        return mp2Settings;
    }

    /**
     * Returns the value of the PassThroughSettings property for this object.
     * 
     * @return The value of the PassThroughSettings property for this object.
     */
    public final PassThroughSettings passThroughSettings() {
        return passThroughSettings;
    }

    /**
     * Returns the value of the WavSettings property for this object.
     * 
     * @return The value of the WavSettings property for this object.
     */
    public final WavSettings wavSettings() {
        return wavSettings;
    }

    @Override
    public Builder toBuilder() {
        return new BuilderImpl(this);
    }

    public static Builder builder() {
        return new BuilderImpl();
    }

    public static Class serializableBuilderClass() {
        return BuilderImpl.class;
    }

    @Override
    public final int hashCode() {
        int hashCode = 1;
        hashCode = 31 * hashCode + Objects.hashCode(aacSettings());
        hashCode = 31 * hashCode + Objects.hashCode(ac3Settings());
        hashCode = 31 * hashCode + Objects.hashCode(eac3AtmosSettings());
        hashCode = 31 * hashCode + Objects.hashCode(eac3Settings());
        hashCode = 31 * hashCode + Objects.hashCode(mp2Settings());
        hashCode = 31 * hashCode + Objects.hashCode(passThroughSettings());
        hashCode = 31 * hashCode + Objects.hashCode(wavSettings());
        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 AudioCodecSettings)) {
            return false;
        }
        AudioCodecSettings other = (AudioCodecSettings) obj;
        return Objects.equals(aacSettings(), other.aacSettings()) && Objects.equals(ac3Settings(), other.ac3Settings())
                && Objects.equals(eac3AtmosSettings(), other.eac3AtmosSettings())
                && Objects.equals(eac3Settings(), other.eac3Settings()) && Objects.equals(mp2Settings(), other.mp2Settings())
                && Objects.equals(passThroughSettings(), other.passThroughSettings())
                && Objects.equals(wavSettings(), other.wavSettings());
    }

    /**
     * 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("AudioCodecSettings").add("AacSettings", aacSettings()).add("Ac3Settings", ac3Settings())
                .add("Eac3AtmosSettings", eac3AtmosSettings()).add("Eac3Settings", eac3Settings())
                .add("Mp2Settings", mp2Settings()).add("PassThroughSettings", passThroughSettings())
                .add("WavSettings", wavSettings()).build();
    }

    public final  Optional getValueForField(String fieldName, Class clazz) {
        switch (fieldName) {
        case "AacSettings":
            return Optional.ofNullable(clazz.cast(aacSettings()));
        case "Ac3Settings":
            return Optional.ofNullable(clazz.cast(ac3Settings()));
        case "Eac3AtmosSettings":
            return Optional.ofNullable(clazz.cast(eac3AtmosSettings()));
        case "Eac3Settings":
            return Optional.ofNullable(clazz.cast(eac3Settings()));
        case "Mp2Settings":
            return Optional.ofNullable(clazz.cast(mp2Settings()));
        case "PassThroughSettings":
            return Optional.ofNullable(clazz.cast(passThroughSettings()));
        case "WavSettings":
            return Optional.ofNullable(clazz.cast(wavSettings()));
        default:
            return Optional.empty();
        }
    }

    @Override
    public final List> sdkFields() {
        return SDK_FIELDS;
    }

    private static  Function getter(Function g) {
        return obj -> g.apply((AudioCodecSettings) obj);
    }

    private static  BiConsumer setter(BiConsumer s) {
        return (obj, val) -> s.accept((Builder) obj, val);
    }

    public interface Builder extends SdkPojo, CopyableBuilder {
        /**
         * Sets the value of the AacSettings property for this object.
         *
         * @param aacSettings
         *        The new value for the AacSettings property for this object.
         * @return Returns a reference to this object so that method calls can be chained together.
         */
        Builder aacSettings(AacSettings aacSettings);

        /**
         * Sets the value of the AacSettings property for this object.
         *
         * This is a convenience method that creates an instance of the {@link AacSettings.Builder} avoiding the need to
         * create one manually via {@link AacSettings#builder()}.
         *
         * 

* When the {@link Consumer} completes, {@link AacSettings.Builder#build()} is called immediately and its result * is passed to {@link #aacSettings(AacSettings)}. * * @param aacSettings * a consumer that will call methods on {@link AacSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #aacSettings(AacSettings) */ default Builder aacSettings(Consumer aacSettings) { return aacSettings(AacSettings.builder().applyMutation(aacSettings).build()); } /** * Sets the value of the Ac3Settings property for this object. * * @param ac3Settings * The new value for the Ac3Settings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ac3Settings(Ac3Settings ac3Settings); /** * Sets the value of the Ac3Settings property for this object. * * This is a convenience method that creates an instance of the {@link Ac3Settings.Builder} avoiding the need to * create one manually via {@link Ac3Settings#builder()}. * *

* When the {@link Consumer} completes, {@link Ac3Settings.Builder#build()} is called immediately and its result * is passed to {@link #ac3Settings(Ac3Settings)}. * * @param ac3Settings * a consumer that will call methods on {@link Ac3Settings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #ac3Settings(Ac3Settings) */ default Builder ac3Settings(Consumer ac3Settings) { return ac3Settings(Ac3Settings.builder().applyMutation(ac3Settings).build()); } /** * Sets the value of the Eac3AtmosSettings property for this object. * * @param eac3AtmosSettings * The new value for the Eac3AtmosSettings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eac3AtmosSettings(Eac3AtmosSettings eac3AtmosSettings); /** * Sets the value of the Eac3AtmosSettings property for this object. * * This is a convenience method that creates an instance of the {@link Eac3AtmosSettings.Builder} avoiding the * need to create one manually via {@link Eac3AtmosSettings#builder()}. * *

* When the {@link Consumer} completes, {@link Eac3AtmosSettings.Builder#build()} is called immediately and its * result is passed to {@link #eac3AtmosSettings(Eac3AtmosSettings)}. * * @param eac3AtmosSettings * a consumer that will call methods on {@link Eac3AtmosSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #eac3AtmosSettings(Eac3AtmosSettings) */ default Builder eac3AtmosSettings(Consumer eac3AtmosSettings) { return eac3AtmosSettings(Eac3AtmosSettings.builder().applyMutation(eac3AtmosSettings).build()); } /** * Sets the value of the Eac3Settings property for this object. * * @param eac3Settings * The new value for the Eac3Settings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eac3Settings(Eac3Settings eac3Settings); /** * Sets the value of the Eac3Settings property for this object. * * This is a convenience method that creates an instance of the {@link Eac3Settings.Builder} avoiding the need * to create one manually via {@link Eac3Settings#builder()}. * *

* When the {@link Consumer} completes, {@link Eac3Settings.Builder#build()} is called immediately and its * result is passed to {@link #eac3Settings(Eac3Settings)}. * * @param eac3Settings * a consumer that will call methods on {@link Eac3Settings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #eac3Settings(Eac3Settings) */ default Builder eac3Settings(Consumer eac3Settings) { return eac3Settings(Eac3Settings.builder().applyMutation(eac3Settings).build()); } /** * Sets the value of the Mp2Settings property for this object. * * @param mp2Settings * The new value for the Mp2Settings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder mp2Settings(Mp2Settings mp2Settings); /** * Sets the value of the Mp2Settings property for this object. * * This is a convenience method that creates an instance of the {@link Mp2Settings.Builder} avoiding the need to * create one manually via {@link Mp2Settings#builder()}. * *

* When the {@link Consumer} completes, {@link Mp2Settings.Builder#build()} is called immediately and its result * is passed to {@link #mp2Settings(Mp2Settings)}. * * @param mp2Settings * a consumer that will call methods on {@link Mp2Settings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #mp2Settings(Mp2Settings) */ default Builder mp2Settings(Consumer mp2Settings) { return mp2Settings(Mp2Settings.builder().applyMutation(mp2Settings).build()); } /** * Sets the value of the PassThroughSettings property for this object. * * @param passThroughSettings * The new value for the PassThroughSettings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder passThroughSettings(PassThroughSettings passThroughSettings); /** * Sets the value of the PassThroughSettings property for this object. * * This is a convenience method that creates an instance of the {@link PassThroughSettings.Builder} avoiding the * need to create one manually via {@link PassThroughSettings#builder()}. * *

* When the {@link Consumer} completes, {@link PassThroughSettings.Builder#build()} is called immediately and * its result is passed to {@link #passThroughSettings(PassThroughSettings)}. * * @param passThroughSettings * a consumer that will call methods on {@link PassThroughSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #passThroughSettings(PassThroughSettings) */ default Builder passThroughSettings(Consumer passThroughSettings) { return passThroughSettings(PassThroughSettings.builder().applyMutation(passThroughSettings).build()); } /** * Sets the value of the WavSettings property for this object. * * @param wavSettings * The new value for the WavSettings property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder wavSettings(WavSettings wavSettings); /** * Sets the value of the WavSettings property for this object. * * This is a convenience method that creates an instance of the {@link WavSettings.Builder} avoiding the need to * create one manually via {@link WavSettings#builder()}. * *

* When the {@link Consumer} completes, {@link WavSettings.Builder#build()} is called immediately and its result * is passed to {@link #wavSettings(WavSettings)}. * * @param wavSettings * a consumer that will call methods on {@link WavSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #wavSettings(WavSettings) */ default Builder wavSettings(Consumer wavSettings) { return wavSettings(WavSettings.builder().applyMutation(wavSettings).build()); } } static final class BuilderImpl implements Builder { private AacSettings aacSettings; private Ac3Settings ac3Settings; private Eac3AtmosSettings eac3AtmosSettings; private Eac3Settings eac3Settings; private Mp2Settings mp2Settings; private PassThroughSettings passThroughSettings; private WavSettings wavSettings; private BuilderImpl() { } private BuilderImpl(AudioCodecSettings model) { aacSettings(model.aacSettings); ac3Settings(model.ac3Settings); eac3AtmosSettings(model.eac3AtmosSettings); eac3Settings(model.eac3Settings); mp2Settings(model.mp2Settings); passThroughSettings(model.passThroughSettings); wavSettings(model.wavSettings); } public final AacSettings.Builder getAacSettings() { return aacSettings != null ? aacSettings.toBuilder() : null; } public final void setAacSettings(AacSettings.BuilderImpl aacSettings) { this.aacSettings = aacSettings != null ? aacSettings.build() : null; } @Override public final Builder aacSettings(AacSettings aacSettings) { this.aacSettings = aacSettings; return this; } public final Ac3Settings.Builder getAc3Settings() { return ac3Settings != null ? ac3Settings.toBuilder() : null; } public final void setAc3Settings(Ac3Settings.BuilderImpl ac3Settings) { this.ac3Settings = ac3Settings != null ? ac3Settings.build() : null; } @Override public final Builder ac3Settings(Ac3Settings ac3Settings) { this.ac3Settings = ac3Settings; return this; } public final Eac3AtmosSettings.Builder getEac3AtmosSettings() { return eac3AtmosSettings != null ? eac3AtmosSettings.toBuilder() : null; } public final void setEac3AtmosSettings(Eac3AtmosSettings.BuilderImpl eac3AtmosSettings) { this.eac3AtmosSettings = eac3AtmosSettings != null ? eac3AtmosSettings.build() : null; } @Override public final Builder eac3AtmosSettings(Eac3AtmosSettings eac3AtmosSettings) { this.eac3AtmosSettings = eac3AtmosSettings; return this; } public final Eac3Settings.Builder getEac3Settings() { return eac3Settings != null ? eac3Settings.toBuilder() : null; } public final void setEac3Settings(Eac3Settings.BuilderImpl eac3Settings) { this.eac3Settings = eac3Settings != null ? eac3Settings.build() : null; } @Override public final Builder eac3Settings(Eac3Settings eac3Settings) { this.eac3Settings = eac3Settings; return this; } public final Mp2Settings.Builder getMp2Settings() { return mp2Settings != null ? mp2Settings.toBuilder() : null; } public final void setMp2Settings(Mp2Settings.BuilderImpl mp2Settings) { this.mp2Settings = mp2Settings != null ? mp2Settings.build() : null; } @Override public final Builder mp2Settings(Mp2Settings mp2Settings) { this.mp2Settings = mp2Settings; return this; } public final PassThroughSettings.Builder getPassThroughSettings() { return passThroughSettings != null ? passThroughSettings.toBuilder() : null; } public final void setPassThroughSettings(PassThroughSettings.BuilderImpl passThroughSettings) { this.passThroughSettings = passThroughSettings != null ? passThroughSettings.build() : null; } @Override public final Builder passThroughSettings(PassThroughSettings passThroughSettings) { this.passThroughSettings = passThroughSettings; return this; } public final WavSettings.Builder getWavSettings() { return wavSettings != null ? wavSettings.toBuilder() : null; } public final void setWavSettings(WavSettings.BuilderImpl wavSettings) { this.wavSettings = wavSettings != null ? wavSettings.build() : null; } @Override public final Builder wavSettings(WavSettings wavSettings) { this.wavSettings = wavSettings; return this; } @Override public AudioCodecSettings build() { return new AudioCodecSettings(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy