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;
 
 
Container for the parameters to the CreateJob operation.

When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the job that is created.

If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS Console).

 
 public class CreateJobRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.

Constraints:
Pattern: ^\d{13}-\w{6}$

 
     private String pipelineId;

    
A section of the request body that provides information about the file that is being transcoded.
 
     private JobInput input;

    
The CreateJobOutput structure.
 
     private CreateJobOutput output;

    
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

Constraints:
Length: 0 - 30

 
The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.

Constraints:
Length: 1 - 255

 
     private String outputKeyPrefix;

    
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

Constraints:
Length: 0 - 30

 
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.
    private java.util.Map<String,StringuserMetadata;

    
The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.

Constraints:
Pattern: ^\d{13}-\w{6}$

Returns:
The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.
    public String getPipelineId() {
        return ;
    }
    
    
The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.

Constraints:
Pattern: ^\d{13}-\w{6}$

Parameters:
pipelineId The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.
    public void setPipelineId(String pipelineId) {
        this. = pipelineId;
    }
    
    
The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.

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

Constraints:
Pattern: ^\d{13}-\w{6}$

Parameters:
pipelineId The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withPipelineId(String pipelineId) {
        this. = pipelineId;
        return this;
    }

    
A section of the request body that provides information about the file that is being transcoded.

Returns:
A section of the request body that provides information about the file that is being transcoded.
    public JobInput getInput() {
        return ;
    }
    
    
A section of the request body that provides information about the file that is being transcoded.

Parameters:
input A section of the request body that provides information about the file that is being transcoded.
    public void setInput(JobInput input) {
        this. = input;
    }
    
    
A section of the request body that provides information about the file that is being transcoded.

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

Parameters:
input A section of the request body that provides information about the file that is being transcoded.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withInput(JobInput input) {
        this. = input;
        return this;
    }

    
The CreateJobOutput structure.

Returns:
The CreateJobOutput structure.
    public CreateJobOutput getOutput() {
        return ;
    }
    
    
The CreateJobOutput structure.

Parameters:
output The CreateJobOutput structure.
    public void setOutput(CreateJobOutput output) {
        this. = output;
    }
    
    
The CreateJobOutput structure.

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

Parameters:
output The CreateJobOutput structure.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withOutput(CreateJobOutput output) {
        this. = output;
        return this;
    }

    
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

Constraints:
Length: 0 - 30

Returns:
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.
    public java.util.List<CreateJobOutputgetOutputs() {
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

Constraints:
Length: 0 - 30

Parameters:
outputs A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.
    public void setOutputs(java.util.Collection<CreateJobOutputoutputs) {
        if (outputs == null) {
            this. = null;
            return;
        }
        outputsCopy.addAll(outputs);
        this. = outputsCopy;
    }
    
    
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

NOTE: This method appends the values to the existing list (if any). Use setOutputs(java.util.Collection) or withOutputs(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 - 30

Parameters:
outputs A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withOutputs(CreateJobOutput... outputs) {
        if (getOutputs() == nullsetOutputs(new java.util.ArrayList<CreateJobOutput>(outputs.length));
        for (CreateJobOutput value : outputs) {
            getOutputs().add(value);
        }
        return this;
    }
    
    
A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

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

Constraints:
Length: 0 - 30

Parameters:
outputs A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (outputs == null) {
            this. = null;
        } else {
            outputsCopy.addAll(outputs);
            this. = outputsCopy;
        }
        return this;
    }

    
The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.

Constraints:
Length: 1 - 255

Returns:
The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.
    public String getOutputKeyPrefix() {
        return ;
    }
    
    
The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.

Constraints:
Length: 1 - 255

Parameters:
outputKeyPrefix The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.
    public void setOutputKeyPrefix(String outputKeyPrefix) {
        this. = outputKeyPrefix;
    }
    
    
The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.

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

Constraints:
Length: 1 - 255

Parameters:
outputKeyPrefix The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withOutputKeyPrefix(String outputKeyPrefix) {
        this. = outputKeyPrefix;
        return this;
    }

    
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

Constraints:
Length: 0 - 30

Returns:
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

Constraints:
Length: 0 - 30

Parameters:
playlists If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

    public void setPlaylists(java.util.Collection<CreateJobPlaylistplaylists) {
        if (playlists == null) {
            this. = null;
            return;
        }
        playlistsCopy.addAll(playlists);
        this. = playlistsCopy;
    }
    
    
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

NOTE: This method appends the values to the existing list (if any). Use setPlaylists(java.util.Collection) or withPlaylists(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 - 30

Parameters:
playlists If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withPlaylists(CreateJobPlaylist... playlists) {
        if (getPlaylists() == nullsetPlaylists(new java.util.ArrayList<CreateJobPlaylist>(playlists.length));
        for (CreateJobPlaylist value : playlists) {
            getPlaylists().add(value);
        }
        return this;
    }
    
    
If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

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

Constraints:
Length: 0 - 30

Parameters:
playlists If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

The maximum number of master playlists in a job is 30.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (playlists == null) {
            this. = null;
        } else {
            playlistsCopy.addAll(playlists);
            this. = playlistsCopy;
        }
        return this;
    }

    
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.

Returns:
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.
    public java.util.Map<String,StringgetUserMetadata() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.

Parameters:
userMetadata User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.
    public void setUserMetadata(java.util.Map<String,StringuserMetadata) {
        this. = userMetadata;
    }
    
    
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.

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

Parameters:
userMetadata User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateJobRequest withUserMetadata(java.util.Map<String,StringuserMetadata) {
        setUserMetadata(userMetadata);
        return this;
    }

    
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs will be returned in the same order in which you specify them.

The method adds a new key-value pair into UserMetadata parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into UserMetadata.
value The corresponding value of the entry to be added into UserMetadata.
  public CreateJobRequest addUserMetadataEntry(String keyString value) {
    if (null == this.) {
      this. = new java.util.HashMap<String,String>();
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into UserMetadata.

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

    this. = null;
    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 (getPipelineId() != nullsb.append("PipelineId: " + getPipelineId() + ",");
        if (getInput() != nullsb.append("Input: " + getInput() + ",");
        if (getOutput() != nullsb.append("Output: " + getOutput() + ",");
        if (getOutputs() != nullsb.append("Outputs: " + getOutputs() + ",");
        if (getOutputKeyPrefix() != nullsb.append("OutputKeyPrefix: " + getOutputKeyPrefix() + ",");
        if (getPlaylists() != nullsb.append("Playlists: " + getPlaylists() + ",");
        if (getUserMetadata() != nullsb.append("UserMetadata: " + getUserMetadata() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getPipelineId() == null) ? 0 : getPipelineId().hashCode()); 
        hashCode = prime * hashCode + ((getInput() == null) ? 0 : getInput().hashCode()); 
        hashCode = prime * hashCode + ((getOutput() == null) ? 0 : getOutput().hashCode()); 
        hashCode = prime * hashCode + ((getOutputs() == null) ? 0 : getOutputs().hashCode()); 
        hashCode = prime * hashCode + ((getOutputKeyPrefix() == null) ? 0 : getOutputKeyPrefix().hashCode()); 
        hashCode = prime * hashCode + ((getPlaylists() == null) ? 0 : getPlaylists().hashCode()); 
        hashCode = prime * hashCode + ((getUserMetadata() == null) ? 0 : getUserMetadata().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateJobRequest == falsereturn false;
        CreateJobRequest other = (CreateJobRequest)obj;
        
        if (other.getPipelineId() == null ^ this.getPipelineId() == nullreturn false;
        if (other.getPipelineId() != null && other.getPipelineId().equals(this.getPipelineId()) == falsereturn false
        if (other.getInput() == null ^ this.getInput() == nullreturn false;
        if (other.getInput() != null && other.getInput().equals(this.getInput()) == falsereturn false
        if (other.getOutput() == null ^ this.getOutput() == nullreturn false;
        if (other.getOutput() != null && other.getOutput().equals(this.getOutput()) == falsereturn false
        if (other.getOutputs() == null ^ this.getOutputs() == nullreturn false;
        if (other.getOutputs() != null && other.getOutputs().equals(this.getOutputs()) == falsereturn false
        if (other.getOutputKeyPrefix() == null ^ this.getOutputKeyPrefix() == nullreturn false;
        if (other.getOutputKeyPrefix() != null && other.getOutputKeyPrefix().equals(this.getOutputKeyPrefix()) == falsereturn false
        if (other.getPlaylists() == null ^ this.getPlaylists() == nullreturn false;
        if (other.getPlaylists() != null && other.getPlaylists().equals(this.getPlaylists()) == falsereturn false
        if (other.getUserMetadata() == null ^ this.getUserMetadata() == nullreturn false;
        if (other.getUserMetadata() != null && other.getUserMetadata().equals(this.getUserMetadata()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateJobRequest clone() {
        
            return (CreateJobRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X