Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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.ec2.model;

Represents a snapshot of an Amazon EC2 EBS volume.

 
 public class Snapshot {

    
The unique ID of this snapshot.
 
     private String snapshotId;

    
The ID of the volume from which this snapshot was created.
 
     private String volumeId;

    
Snapshot state (e.g., pending, completed, or error).

Constraints:
Allowed Values: pending, completed, error

 
     private String state;

    
Time stamp when the snapshot was initiated.
 
     private java.util.Date startTime;

    
The progress of the snapshot, in percentage.
 
     private String progress;

    
AWS Access Key ID of the user who owns the snapshot.
 
     private String ownerId;

    
Description of the snapshot.
 
     private String description;

    
The size of the volume, in gigabytes.
 
     private Integer volumeSize;

    
The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.
 
     private String ownerAlias;

    
A list of tags for the Snapshot.
 
     private java.util.List<Tagtags;

    
The unique ID of this snapshot.

Returns:
The unique ID of this snapshot.
 
     public String getSnapshotId() {
         return ;
     }
    
    
The unique ID of this snapshot.

Parameters:
snapshotId The unique ID of this snapshot.
 
     public void setSnapshotId(String snapshotId) {
         this. = snapshotId;
     }
    
    
The unique ID of this snapshot.

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

Parameters:
snapshotId The unique ID of this snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withSnapshotId(String snapshotId) {
        this. = snapshotId;
        return this;
    }
    
    
    
The ID of the volume from which this snapshot was created.

Returns:
The ID of the volume from which this snapshot was created.
    public String getVolumeId() {
        return ;
    }
    
    
The ID of the volume from which this snapshot was created.

Parameters:
volumeId The ID of the volume from which this snapshot was created.
    public void setVolumeId(String volumeId) {
        this. = volumeId;
    }
    
    
The ID of the volume from which this snapshot was created.

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

Parameters:
volumeId The ID of the volume from which this snapshot was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withVolumeId(String volumeId) {
        this. = volumeId;
        return this;
    }
    
    
    
Snapshot state (e.g., pending, completed, or error).

Constraints:
Allowed Values: pending, completed, error

Returns:
Snapshot state (e.g., pending, completed, or error).
See also:
SnapshotState
    public String getState() {
        return ;
    }
    
    
Snapshot state (e.g., pending, completed, or error).

Constraints:
Allowed Values: pending, completed, error

Parameters:
state Snapshot state (e.g., pending, completed, or error).
See also:
SnapshotState
    public void setState(String state) {
        this. = state;
    }
    
    
Snapshot state (e.g., pending, completed, or error).

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

Constraints:
Allowed Values: pending, completed, error

Parameters:
state Snapshot state (e.g., pending, completed, or error).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SnapshotState
    public Snapshot withState(String state) {
        this. = state;
        return this;
    }
    
    
    
Time stamp when the snapshot was initiated.

Returns:
Time stamp when the snapshot was initiated.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
Time stamp when the snapshot was initiated.

Parameters:
startTime Time stamp when the snapshot was initiated.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
Time stamp when the snapshot was initiated.

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

Parameters:
startTime Time stamp when the snapshot was initiated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withStartTime(java.util.Date startTime) {
        this. = startTime;
        return this;
    }
    
    
    
The progress of the snapshot, in percentage.

Returns:
The progress of the snapshot, in percentage.
    public String getProgress() {
        return ;
    }
    
    
The progress of the snapshot, in percentage.

Parameters:
progress The progress of the snapshot, in percentage.
    public void setProgress(String progress) {
        this. = progress;
    }
    
    
The progress of the snapshot, in percentage.

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

Parameters:
progress The progress of the snapshot, in percentage.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withProgress(String progress) {
        this. = progress;
        return this;
    }
    
    
    
AWS Access Key ID of the user who owns the snapshot.

Returns:
AWS Access Key ID of the user who owns the snapshot.
    public String getOwnerId() {
        return ;
    }
    
    
AWS Access Key ID of the user who owns the snapshot.

Parameters:
ownerId AWS Access Key ID of the user who owns the snapshot.
    public void setOwnerId(String ownerId) {
        this. = ownerId;
    }
    
    
AWS Access Key ID of the user who owns the snapshot.

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

Parameters:
ownerId AWS Access Key ID of the user who owns the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withOwnerId(String ownerId) {
        this. = ownerId;
        return this;
    }
    
    
    
Description of the snapshot.

Returns:
Description of the snapshot.
    public String getDescription() {
        return ;
    }
    
    
Description of the snapshot.

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

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

Parameters:
description Description of the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withDescription(String description) {
        this. = description;
        return this;
    }
    
    
    
The size of the volume, in gigabytes.

Returns:
The size of the volume, in gigabytes.
    public Integer getVolumeSize() {
        return ;
    }
    
    
The size of the volume, in gigabytes.

Parameters:
volumeSize The size of the volume, in gigabytes.
    public void setVolumeSize(Integer volumeSize) {
        this. = volumeSize;
    }
    
    
The size of the volume, in gigabytes.

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

Parameters:
volumeSize The size of the volume, in gigabytes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withVolumeSize(Integer volumeSize) {
        this. = volumeSize;
        return this;
    }
    
    
    
The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.

Returns:
The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.
    public String getOwnerAlias() {
        return ;
    }
    
    
The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.

Parameters:
ownerAlias The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.
    public void setOwnerAlias(String ownerAlias) {
        this. = ownerAlias;
    }
    
    
The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.

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

Parameters:
ownerAlias The AWS account alias (e.g., "amazon", "redhat", "self", etc.) or AWS account ID that owns the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withOwnerAlias(String ownerAlias) {
        this. = ownerAlias;
        return this;
    }
    
    
    
A list of tags for the Snapshot.

Returns:
A list of tags for the Snapshot.
    public java.util.List<TaggetTags() {
        if ( == null) {
             = new java.util.ArrayList<Tag>();
        }
        return ;
    }
    
    
A list of tags for the Snapshot.

Parameters:
tags A list of tags for the Snapshot.
    public void setTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
    }
    
    
A list of tags for the Snapshot.

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

Parameters:
tags A list of tags for the Snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withTags(Tag... tags) {
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
A list of tags for the Snapshot.

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

Parameters:
tags A list of tags for the Snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
        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("{");
        sb.append("SnapshotId: " +  + ", ");
        sb.append("VolumeId: " +  + ", ");
        sb.append("State: " +  + ", ");
        sb.append("StartTime: " +  + ", ");
        sb.append("Progress: " +  + ", ");
        sb.append("OwnerId: " +  + ", ");
        sb.append("Description: " +  + ", ");
        sb.append("VolumeSize: " +  + ", ");
        sb.append("OwnerAlias: " +  + ", ");
        sb.append("Tags: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X