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;
 

Presets are templates that contain most of the settings for transcoding media files from one format to another. Elastic Transcoder includes some default presets for common formats, for example, several iPod and iPhone versions. You can also create your own presets for formats that aren't included among the default presets. You specify which preset you want to use when you create a job.

 
 public class Preset implements SerializableCloneable {

    
Identifier for the new preset. You use this value to get settings for the preset or to delete it.

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

 
     private String id;

    
The Amazon Resource Name (ARN) for the preset.
 
     private String arn;

    
The name of the preset.

Constraints:
Length: 1 - 40

 
     private String name;

    
A description of the preset.

Constraints:
Length: 0 - 255

 
     private String description;

    
The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.

Constraints:
Pattern: (^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)

 
     private String container;

    
A section of the response body that provides information about the audio preset values.
 
     private AudioParameters audio;

    
A section of the response body that provides information about the video preset values.
 
     private VideoParameters video;

    
A section of the response body that provides information about the thumbnail preset values, if any.
 
     private Thumbnails thumbnails;

    
Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).

Constraints:
Pattern: (^System$)|(^Custom$)

 
     private String type;

    
Identifier for the new preset. You use this value to get settings for the preset or to delete it.

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

Returns:
Identifier for the new preset. You use this value to get settings for the preset or to delete it.
    public String getId() {
        return ;
    }
    
    
Identifier for the new preset. You use this value to get settings for the preset or to delete it.

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

Parameters:
id Identifier for the new preset. You use this value to get settings for the preset or to delete it.
    public void setId(String id) {
        this. = id;
    }
    
    
Identifier for the new preset. You use this value to get settings for the preset or to delete it.

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

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

Parameters:
id Identifier for the new preset. You use this value to get settings for the preset or to delete it.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withId(String id) {
        this. = id;
        return this;
    }

    
The Amazon Resource Name (ARN) for the preset.

Returns:
The Amazon Resource Name (ARN) for the preset.
    public String getArn() {
        return ;
    }
    
    
The Amazon Resource Name (ARN) for the preset.

Parameters:
arn The Amazon Resource Name (ARN) for the preset.
    public void setArn(String arn) {
        this. = arn;
    }
    
    
The Amazon Resource Name (ARN) for the preset.

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

Parameters:
arn The Amazon Resource Name (ARN) for the preset.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withArn(String arn) {
        this. = arn;
        return this;
    }

    
The name of the preset.

Constraints:
Length: 1 - 40

Returns:
The name of the preset.
    public String getName() {
        return ;
    }
    
    
The name of the preset.

Constraints:
Length: 1 - 40

Parameters:
name The name of the preset.
    public void setName(String name) {
        this. = name;
    }
    
    
The name of the preset.

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

Constraints:
Length: 1 - 40

Parameters:
name The name of the preset.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withName(String name) {
        this. = name;
        return this;
    }

    
A description of the preset.

Constraints:
Length: 0 - 255

Returns:
A description of the preset.
    public String getDescription() {
        return ;
    }
    
    
A description of the preset.

Constraints:
Length: 0 - 255

Parameters:
description A description of the preset.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description of the preset.

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

Constraints:
Length: 0 - 255

Parameters:
description A description of the preset.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withDescription(String description) {
        this. = description;
        return this;
    }

    
The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.

Constraints:
Pattern: (^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)

Returns:
The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.
    public String getContainer() {
        return ;
    }
    
    
The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.

Constraints:
Pattern: (^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)

Parameters:
container The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.
    public void setContainer(String container) {
        this. = container;
    }
    
    
The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.

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

Constraints:
Pattern: (^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)

Parameters:
container The container type for the output file. Valid values include flv, fmp4, gif, mp3, mp4, mpg, ogg, ts, and webm.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withContainer(String container) {
        this. = container;
        return this;
    }

    
A section of the response body that provides information about the audio preset values.

Returns:
A section of the response body that provides information about the audio preset values.
    public AudioParameters getAudio() {
        return ;
    }
    
    
A section of the response body that provides information about the audio preset values.

Parameters:
audio A section of the response body that provides information about the audio preset values.
    public void setAudio(AudioParameters audio) {
        this. = audio;
    }
    
    
A section of the response body that provides information about the audio preset values.

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

Parameters:
audio A section of the response body that provides information about the audio preset values.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withAudio(AudioParameters audio) {
        this. = audio;
        return this;
    }

    
A section of the response body that provides information about the video preset values.

Returns:
A section of the response body that provides information about the video preset values.
    public VideoParameters getVideo() {
        return ;
    }
    
    
A section of the response body that provides information about the video preset values.

Parameters:
video A section of the response body that provides information about the video preset values.
    public void setVideo(VideoParameters video) {
        this. = video;
    }
    
    
A section of the response body that provides information about the video preset values.

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

Parameters:
video A section of the response body that provides information about the video preset values.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withVideo(VideoParameters video) {
        this. = video;
        return this;
    }

    
A section of the response body that provides information about the thumbnail preset values, if any.

Returns:
A section of the response body that provides information about the thumbnail preset values, if any.
    public Thumbnails getThumbnails() {
        return ;
    }
    
    
A section of the response body that provides information about the thumbnail preset values, if any.

Parameters:
thumbnails A section of the response body that provides information about the thumbnail preset values, if any.
    public void setThumbnails(Thumbnails thumbnails) {
        this. = thumbnails;
    }
    
    
A section of the response body that provides information about the thumbnail preset values, if any.

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

Parameters:
thumbnails A section of the response body that provides information about the thumbnail preset values, if any.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withThumbnails(Thumbnails thumbnails) {
        this. = thumbnails;
        return this;
    }

    
Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).

Constraints:
Pattern: (^System$)|(^Custom$)

Returns:
Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).
    public String getType() {
        return ;
    }
    
    
Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).

Constraints:
Pattern: (^System$)|(^Custom$)

Parameters:
type Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).
    public void setType(String type) {
        this. = type;
    }
    
    
Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).

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

Constraints:
Pattern: (^System$)|(^Custom$)

Parameters:
type Whether the preset is a default preset provided by Elastic Transcoder (System) or a preset that you have defined (Custom).
Returns:
A reference to this updated object so that method calls can be chained together.
    public Preset withType(String type) {
        this. = type;
        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 (getId() != nullsb.append("Id: " + getId() + ",");
        if (getArn() != nullsb.append("Arn: " + getArn() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getContainer() != nullsb.append("Container: " + getContainer() + ",");
        if (getAudio() != nullsb.append("Audio: " + getAudio() + ",");
        if (getVideo() != nullsb.append("Video: " + getVideo() + ",");
        if (getThumbnails() != nullsb.append("Thumbnails: " + getThumbnails() + ",");
        if (getType() != nullsb.append("Type: " + getType() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); 
        hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getContainer() == null) ? 0 : getContainer().hashCode()); 
        hashCode = prime * hashCode + ((getAudio() == null) ? 0 : getAudio().hashCode()); 
        hashCode = prime * hashCode + ((getVideo() == null) ? 0 : getVideo().hashCode()); 
        hashCode = prime * hashCode + ((getThumbnails() == null) ? 0 : getThumbnails().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Preset == falsereturn false;
        Preset other = (Preset)obj;
        
        if (other.getId() == null ^ this.getId() == nullreturn false;
        if (other.getId() != null && other.getId().equals(this.getId()) == falsereturn false
        if (other.getArn() == null ^ this.getArn() == nullreturn false;
        if (other.getArn() != null && other.getArn().equals(this.getArn()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getContainer() == null ^ this.getContainer() == nullreturn false;
        if (other.getContainer() != null && other.getContainer().equals(this.getContainer()) == falsereturn false
        if (other.getAudio() == null ^ this.getAudio() == nullreturn false;
        if (other.getAudio() != null && other.getAudio().equals(this.getAudio()) == falsereturn false
        if (other.getVideo() == null ^ this.getVideo() == nullreturn false;
        if (other.getVideo() != null && other.getVideo().equals(this.getVideo()) == falsereturn false
        if (other.getThumbnails() == null ^ this.getThumbnails() == nullreturn false;
        if (other.getThumbnails() != null && other.getThumbnails().equals(this.getThumbnails()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        return true;
    }
    
    @Override
    public Preset clone() {
        try {
            return (Presetsuper.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