Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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 com.amazonaws.services.elastictranscoder.model;
 

The captions to be created, if any.

 
 public class Captions implements SerializableCloneable {

    
A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

Constraints:
Pattern: (^MergeOverride$)|(^MergeRetain$)|(^Override$)

 
     private String mergePolicy;

    
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.

Constraints:
Length: 0 - 20

 
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.

Constraints:
Length: 0 - 4

 
A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

Constraints:
Pattern: (^MergeOverride$)|(^MergeRetain$)|(^Override$)

Returns:
A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

    public String getMergePolicy() {
        return ;
    }
    
    
A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

Constraints:
Pattern: (^MergeOverride$)|(^MergeRetain$)|(^Override$)

Parameters:
mergePolicy A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

    public void setMergePolicy(String mergePolicy) {
        this. = mergePolicy;
    }
    
    
A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^MergeOverride$)|(^MergeRetain$)|(^Override$)

Parameters:
mergePolicy A policy that determines how Elastic Transcoder handles the existence of multiple captions.
  • MergeOverride: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the sidecar captions and ignores the embedded captions for that language.

  • MergeRetain: Elastic Transcoder transcodes both embedded and sidecar captions into outputs. If captions for a language are embedded in the input file and also appear in a sidecar file, Elastic Transcoder uses the embedded captions and ignores the sidecar captions for that language. If CaptionSources is empty, Elastic Transcoder omits all sidecar captions from the output files.

  • Override: Elastic Transcoder transcodes only the sidecar captions that you specify in CaptionSources.

MergePolicy cannot be null.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Captions withMergePolicy(String mergePolicy) {
        this. = mergePolicy;
        return this;
    }

    
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.

Constraints:
Length: 0 - 20

Returns:
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.

Constraints:
Length: 0 - 20

Parameters:
captionSources Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.
    public void setCaptionSources(java.util.Collection<CaptionSourcecaptionSources) {
        if (captionSources == null) {
            this. = null;
            return;
        }
        captionSourcesCopy.addAll(captionSources);
        this. = captionSourcesCopy;
    }
    
    
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.

NOTE: This method appends the values to the existing list (if any). Use setCaptionSources(java.util.Collection) or withCaptionSources(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 20

Parameters:
captionSources Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Captions withCaptionSources(CaptionSource... captionSources) {
        if (getCaptionSources() == nullsetCaptionSources(new java.util.ArrayList<CaptionSource>(captionSources.length));
        for (CaptionSource value : captionSources) {
            getCaptionSources().add(value);
        }
        return this;
    }
    
    
Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 20

Parameters:
captionSources Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave CaptionSources blank.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Captions withCaptionSources(java.util.Collection<CaptionSourcecaptionSources) {
        if (captionSources == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<CaptionSourcecaptionSourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<CaptionSource>(captionSources.size());
            captionSourcesCopy.addAll(captionSources);
            this. = captionSourcesCopy;
        }
        return this;
    }

    
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.

Constraints:
Length: 0 - 4

Returns:
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.

Constraints:
Length: 0 - 4

Parameters:
captionFormats The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.
    public void setCaptionFormats(java.util.Collection<CaptionFormatcaptionFormats) {
        if (captionFormats == null) {
            this. = null;
            return;
        }
        captionFormatsCopy.addAll(captionFormats);
        this. = captionFormatsCopy;
    }
    
    
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.

NOTE: This method appends the values to the existing list (if any). Use setCaptionFormats(java.util.Collection) or withCaptionFormats(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 4

Parameters:
captionFormats The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Captions withCaptionFormats(CaptionFormat... captionFormats) {
        if (getCaptionFormats() == nullsetCaptionFormats(new java.util.ArrayList<CaptionFormat>(captionFormats.length));
        for (CaptionFormat value : captionFormats) {
            getCaptionFormats().add(value);
        }
        return this;
    }
    
    
The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 4

Parameters:
captionFormats The array of file formats for the output captions. If you leave this value blank, Elastic Transcoder returns an error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Captions withCaptionFormats(java.util.Collection<CaptionFormatcaptionFormats) {
        if (captionFormats == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<CaptionFormatcaptionFormatsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<CaptionFormat>(captionFormats.size());
            captionFormatsCopy.addAll(captionFormats);
            this. = captionFormatsCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getMergePolicy() != nullsb.append("MergePolicy: " + getMergePolicy() + ",");
        if (getCaptionSources() != nullsb.append("CaptionSources: " + getCaptionSources() + ",");
        if (getCaptionFormats() != nullsb.append("CaptionFormats: " + getCaptionFormats() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getMergePolicy() == null) ? 0 : getMergePolicy().hashCode()); 
        hashCode = prime * hashCode + ((getCaptionSources() == null) ? 0 : getCaptionSources().hashCode()); 
        hashCode = prime * hashCode + ((getCaptionFormats() == null) ? 0 : getCaptionFormats().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Captions == falsereturn false;
        Captions other = (Captions)obj;
        
        if (other.getMergePolicy() == null ^ this.getMergePolicy() == nullreturn false;
        if (other.getMergePolicy() != null && other.getMergePolicy().equals(this.getMergePolicy()) == falsereturn false
        if (other.getCaptionSources() == null ^ this.getCaptionSources() == nullreturn false;
        if (other.getCaptionSources() != null && other.getCaptionSources().equals(this.getCaptionSources()) == falsereturn false
        if (other.getCaptionFormats() == null ^ this.getCaptionFormats() == nullreturn false;
        if (other.getCaptionFormats() != null && other.getCaptionFormats().equals(this.getCaptionFormats()) == falsereturn false
        return true;
    }
    
    @Override
    public Captions clone() {
        try {
            return (Captionssuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X