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;
 

A source file for the input sidecar captions used during the transcoding process.

 
 public class CaptionSource implements SerializableCloneable {

    
The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.

Constraints:
Length: 1 - 255

 
     private String key;

    
A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

Constraints:
Length: 1 - 255

 
     private String language;

    
For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

Constraints:
Pattern: (^[+-]?\d{1,5}(\.\d{0,3})?$)|(^[+-]?([0-1]?[0-9]:|2[0-3]:)?([0-5]?[0-9]:)?[0-5]?[0-9](\.\d{0,3})?$)

 
     private String timeOffset;

    
The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.

Constraints:
Length: 1 - 40

 
     private String label;

    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.
 
     private Encryption encryption;

    
The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.

Constraints:
Length: 1 - 255

Returns:
The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.
 
     public String getKey() {
         return ;
     }
    
    
The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.

Constraints:
Length: 1 - 255

Parameters:
key The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.
 
     public void setKey(String key) {
         this. = key;
    }
    
    
The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.

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

Constraints:
Length: 1 - 255

Parameters:
key The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionSource withKey(String key) {
        this. = key;
        return this;
    }

    
A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

Constraints:
Length: 1 - 255

Returns:
A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

    public String getLanguage() {
        return ;
    }
    
    
A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

Constraints:
Length: 1 - 255

Parameters:
language A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

    public void setLanguage(String language) {
        this. = language;
    }
    
    
A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

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

Constraints:
Length: 1 - 255

Parameters:
language A string that specifies the language of the caption. Specify this as one of:
  • 2-character ISO 639-1 code

  • 3-character ISO 639-2 code

For more information on ISO language codes and language names, see the List of ISO 639-1 codes.

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

    
For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

Constraints:
Pattern: (^[+-]?\d{1,5}(\.\d{0,3})?$)|(^[+-]?([0-1]?[0-9]:|2[0-3]:)?([0-5]?[0-9]:)?[0-5]?[0-9](\.\d{0,3})?$)

Returns:
For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

    public String getTimeOffset() {
        return ;
    }
    
    
For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

Constraints:
Pattern: (^[+-]?\d{1,5}(\.\d{0,3})?$)|(^[+-]?([0-1]?[0-9]:|2[0-3]:)?([0-5]?[0-9]:)?[0-5]?[0-9](\.\d{0,3})?$)

Parameters:
timeOffset For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

    public void setTimeOffset(String timeOffset) {
        this. = timeOffset;
    }
    
    
For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

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

Constraints:
Pattern: (^[+-]?\d{1,5}(\.\d{0,3})?$)|(^[+-]?([0-1]?[0-9]:|2[0-3]:)?([0-5]?[0-9]:)?[0-5]?[0-9](\.\d{0,3})?$)

Parameters:
timeOffset For clip generation or captions that do not start at the same time as the associated video file, the TimeOffset tells Elastic Transcoder how much of the video to encode before including captions.

Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.

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

    
The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.

Constraints:
Length: 1 - 40

Returns:
The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.
    public String getLabel() {
        return ;
    }
    
    
The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.

Constraints:
Length: 1 - 40

Parameters:
label The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.
    public void setLabel(String label) {
        this. = label;
    }
    
    
The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.

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

Constraints:
Length: 1 - 40

Parameters:
label The label of the caption shown in the player when choosing a language. We recommend that you put the caption language name here, in the language of the captions.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionSource withLabel(String label) {
        this. = label;
        return this;
    }

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

Returns:
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.
    public Encryption getEncryption() {
        return ;
    }
    
    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.

Parameters:
encryption The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.
    public void setEncryption(Encryption encryption) {
        this. = encryption;
    }
    
    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.

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

Parameters:
encryption The encryption settings, if any, that you want Elastic Transcoder to apply to your caption sources.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionSource withEncryption(Encryption encryption) {
        this. = encryption;
        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 (getKey() != nullsb.append("Key: " + getKey() + ",");
        if (getLanguage() != nullsb.append("Language: " + getLanguage() + ",");
        if (getTimeOffset() != nullsb.append("TimeOffset: " + getTimeOffset() + ",");
        if (getLabel() != nullsb.append("Label: " + getLabel() + ",");
        if (getEncryption() != nullsb.append("Encryption: " + getEncryption() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); 
        hashCode = prime * hashCode + ((getLanguage() == null) ? 0 : getLanguage().hashCode()); 
        hashCode = prime * hashCode + ((getTimeOffset() == null) ? 0 : getTimeOffset().hashCode()); 
        hashCode = prime * hashCode + ((getLabel() == null) ? 0 : getLabel().hashCode()); 
        hashCode = prime * hashCode + ((getEncryption() == null) ? 0 : getEncryption().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CaptionSource == falsereturn false;
        CaptionSource other = (CaptionSource)obj;
        
        if (other.getKey() == null ^ this.getKey() == nullreturn false;
        if (other.getKey() != null && other.getKey().equals(this.getKey()) == falsereturn false
        if (other.getLanguage() == null ^ this.getLanguage() == nullreturn false;
        if (other.getLanguage() != null && other.getLanguage().equals(this.getLanguage()) == falsereturn false
        if (other.getTimeOffset() == null ^ this.getTimeOffset() == nullreturn false;
        if (other.getTimeOffset() != null && other.getTimeOffset().equals(this.getTimeOffset()) == falsereturn false
        if (other.getLabel() == null ^ this.getLabel() == nullreturn false;
        if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == falsereturn false
        if (other.getEncryption() == null ^ this.getEncryption() == nullreturn false;
        if (other.getEncryption() != null && other.getEncryption().equals(this.getEncryption()) == falsereturn false
        return true;
    }
    
    @Override
    public CaptionSource clone() {
        try {
            return (CaptionSourcesuper.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