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

software.amazon.awssdk.services.elastictranscoder.model.CaptionFormat Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Elastic Transcoder module holds the client classes that are used for communicating with Amazon Elastic Transcoder Service

There is a newer version: 2.29.17
Show newest version
/*
 * 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.elastictranscoder.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;

/**
 * 

* The file format of the output captions. If you leave this value blank, Elastic Transcoder returns an error. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CaptionFormat implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Format") .getter(getter(CaptionFormat::format)).setter(setter(Builder::format)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Format").build()).build(); private static final SdkField PATTERN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Pattern") .getter(getter(CaptionFormat::pattern)).setter(setter(Builder::pattern)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Pattern").build()).build(); private static final SdkField ENCRYPTION_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Encryption").getter(getter(CaptionFormat::encryption)).setter(setter(Builder::encryption)) .constructor(Encryption::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encryption").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FORMAT_FIELD, PATTERN_FIELD, ENCRYPTION_FIELD)); private static final long serialVersionUID = 1L; private final String format; private final String pattern; private final Encryption encryption; private CaptionFormat(BuilderImpl builder) { this.format = builder.format; this.pattern = builder.pattern; this.encryption = builder.encryption; } /** *

* The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this * output. *

*
    *
  • *

    * Valid Embedded Caption Formats: *

    *
      *
    • *

      * for FLAC: None *

      *
    • *
    • *

      * For MP3: None *

      *
    • *
    • *

      * For MP4: mov-text *

      *
    • *
    • *

      * For MPEG-TS: None *

      *
    • *
    • *

      * For ogg: None *

      *
    • *
    • *

      * For webm: None *

      *
    • *
    *
  • *
  • *

    * Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and * webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format. *

    *
      *
    • *

      * For FMP4: dfxp *

      *
    • *
    • *

      * Non-FMP4 outputs: All sidecar types *

      *
    • *
    *

    * fmp4 captions have an extension of .ismt *

    *
  • *
* * @return The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for * this output.

*
    *
  • *

    * Valid Embedded Caption Formats: *

    *
      *
    • *

      * for FLAC: None *

      *
    • *
    • *

      * For MP3: None *

      *
    • *
    • *

      * For MP4: mov-text *

      *
    • *
    • *

      * For MPEG-TS: None *

      *
    • *
    • *

      * For ogg: None *

      *
    • *
    • *

      * For webm: None *

      *
    • *
    *
  • *
  • *

    * Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, * srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format. *

    *
      *
    • *

      * For FMP4: dfxp *

      *
    • *
    • *

      * Non-FMP4 outputs: All sidecar types *

      *
    • *
    *

    * fmp4 captions have an extension of .ismt *

    *
  • */ public final String format() { return format; } /** *

    * The prefix for caption filenames, in the form description-{language}, where: *

    *
      *
    • *

      * description is a description of the video. *

      *
    • *
    • *

      * {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code * for the language of the caption in the output file names. *

      *
    • *
    *

    * If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends " * {language}" to the value that you specify for the description. In addition, Elastic Transcoder * automatically appends the count to the end of the segment files. *

    *

    * For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the * language of the captions is English (en), the name of the first caption file is be Sydney-en-sunrise00000.srt. *

    * * @return The prefix for caption filenames, in the form description-{language}, where:

    *
      *
    • *

      * description is a description of the video. *

      *
    • *
    • *

      * {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter * code for the language of the caption in the output file names. *

      *
    • *
    *

    * If you don't include {language} in the file name pattern, Elastic Transcoder automatically * appends "{language}" to the value that you specify for the description. In addition, Elastic * Transcoder automatically appends the count to the end of the segment files. *

    *

    * For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and * the language of the captions is English (en), the name of the first caption file is be * Sydney-en-sunrise00000.srt. */ public final String pattern() { return pattern; } /** *

    * The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats. *

    * * @return The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats. */ public final Encryption encryption() { return encryption; } @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(format()); hashCode = 31 * hashCode + Objects.hashCode(pattern()); hashCode = 31 * hashCode + Objects.hashCode(encryption()); 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 CaptionFormat)) { return false; } CaptionFormat other = (CaptionFormat) obj; return Objects.equals(format(), other.format()) && Objects.equals(pattern(), other.pattern()) && Objects.equals(encryption(), other.encryption()); } /** * 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("CaptionFormat").add("Format", format()).add("Pattern", pattern()) .add("Encryption", encryption()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Format": return Optional.ofNullable(clazz.cast(format())); case "Pattern": return Optional.ofNullable(clazz.cast(pattern())); case "Encryption": return Optional.ofNullable(clazz.cast(encryption())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CaptionFormat) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for * this output. *

    *
      *
    • *

      * Valid Embedded Caption Formats: *

      *
        *
      • *

        * for FLAC: None *

        *
      • *
      • *

        * For MP3: None *

        *
      • *
      • *

        * For MP4: mov-text *

        *
      • *
      • *

        * For MPEG-TS: None *

        *
      • *
      • *

        * For ogg: None *

        *
      • *
      • *

        * For webm: None *

        *
      • *
      *
    • *
    • *

      * Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, * and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format. *

      *
        *
      • *

        * For FMP4: dfxp *

        *
      • *
      • *

        * Non-FMP4 outputs: All sidecar types *

        *
      • *
      *

      * fmp4 captions have an extension of .ismt *

      *
    • *
    * * @param format * The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption * for this output.

    *
      *
    • *

      * Valid Embedded Caption Formats: *

      *
        *
      • *

        * for FLAC: None *

        *
      • *
      • *

        * For MP3: None *

        *
      • *
      • *

        * For MP4: mov-text *

        *
      • *
      • *

        * For MPEG-TS: None *

        *
      • *
      • *

        * For ogg: None *

        *
      • *
      • *

        * For webm: None *

        *
      • *
      *
    • *
    • *

      * Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, * srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format. *

      *
        *
      • *

        * For FMP4: dfxp *

        *
      • *
      • *

        * Non-FMP4 outputs: All sidecar types *

        *
      • *
      *

      * fmp4 captions have an extension of .ismt *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder format(String format); /** *

      * The prefix for caption filenames, in the form description-{language}, where: *

      *
        *
      • *

        * description is a description of the video. *

        *
      • *
      • *

        * {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter * code for the language of the caption in the output file names. *

        *
      • *
      *

      * If you don't include {language} in the file name pattern, Elastic Transcoder automatically * appends "{language}" to the value that you specify for the description. In addition, Elastic * Transcoder automatically appends the count to the end of the segment files. *

      *

      * For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the * language of the captions is English (en), the name of the first caption file is be * Sydney-en-sunrise00000.srt. *

      * * @param pattern * The prefix for caption filenames, in the form description-{language}, where:

      *
        *
      • *

        * description is a description of the video. *

        *
      • *
      • *

        * {language} is a literal value that Elastic Transcoder replaces with the two- or * three-letter code for the language of the caption in the output file names. *

        *
      • *
      *

      * If you don't include {language} in the file name pattern, Elastic Transcoder * automatically appends "{language}" to the value that you specify for the description. In * addition, Elastic Transcoder automatically appends the count to the end of the segment files. *

      *

      * For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", * and the language of the captions is English (en), the name of the first caption file is be * Sydney-en-sunrise00000.srt. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pattern(String pattern); /** *

      * The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats. *

      * * @param encryption * The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryption(Encryption encryption); /** *

      * The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats. *

      * This is a convenience method that creates an instance of the {@link Encryption.Builder} avoiding the need to * create one manually via {@link Encryption#builder()}. * *

      * When the {@link Consumer} completes, {@link Encryption.Builder#build()} is called immediately and its result * is passed to {@link #encryption(Encryption)}. * * @param encryption * a consumer that will call methods on {@link Encryption.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #encryption(Encryption) */ default Builder encryption(Consumer encryption) { return encryption(Encryption.builder().applyMutation(encryption).build()); } } static final class BuilderImpl implements Builder { private String format; private String pattern; private Encryption encryption; private BuilderImpl() { } private BuilderImpl(CaptionFormat model) { format(model.format); pattern(model.pattern); encryption(model.encryption); } public final String getFormat() { return format; } public final void setFormat(String format) { this.format = format; } @Override public final Builder format(String format) { this.format = format; return this; } public final String getPattern() { return pattern; } public final void setPattern(String pattern) { this.pattern = pattern; } @Override public final Builder pattern(String pattern) { this.pattern = pattern; return this; } public final Encryption.Builder getEncryption() { return encryption != null ? encryption.toBuilder() : null; } public final void setEncryption(Encryption.BuilderImpl encryption) { this.encryption = encryption != null ? encryption.build() : null; } @Override public final Builder encryption(Encryption encryption) { this.encryption = encryption; return this; } @Override public CaptionFormat build() { return new CaptionFormat(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy