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 an Amazon Elastic Block Storage (EBS) volume.

 
 public class Volume {

    
The unique ID of this volume.
 
     private String volumeId;

    
The size of this volume, in gigabytes.
 
     private Integer size;

    
Optional snapshot from which this volume was created.
 
     private String snapshotId;

    
Availability zone in which this volume was created.
 
     private String availabilityZone;

    
State of this volume (e.g., creating, available).

Constraints:
Allowed Values: creating, available, in-use, deleting, error

 
     private String state;

    
Timestamp when volume creation was initiated.
 
     private java.util.Date createTime;

    
Information on what this volume is attached to.
 
     private java.util.List<VolumeAttachmentattachments;

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

    
The unique ID of this volume.

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

Parameters:
volumeId The unique ID of this volume.
 
     public void setVolumeId(String volumeId) {
         this. = volumeId;
     }
    
    
The unique ID of this volume.

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

Parameters:
volumeId The unique ID of this volume.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Volume withVolumeId(String volumeId) {
         this. = volumeId;
         return this;
     }
    
    
    
The size of this volume, in gigabytes.

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

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

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

Parameters:
size The size of this volume, in gigabytes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withSize(Integer size) {
        this. = size;
        return this;
    }
    
    
    
Optional snapshot from which this volume was created.

Returns:
Optional snapshot from which this volume was created.
    public String getSnapshotId() {
        return ;
    }
    
    
Optional snapshot from which this volume was created.

Parameters:
snapshotId Optional snapshot from which this volume was created.
    public void setSnapshotId(String snapshotId) {
        this. = snapshotId;
    }
    
    
Optional snapshot from which this volume was created.

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

Parameters:
snapshotId Optional snapshot from which this volume was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withSnapshotId(String snapshotId) {
        this. = snapshotId;
        return this;
    }
    
    
    
Availability zone in which this volume was created.

Returns:
Availability zone in which this volume was created.
    public String getAvailabilityZone() {
        return ;
    }
    
    
Availability zone in which this volume was created.

Parameters:
availabilityZone Availability zone in which this volume was created.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
Availability zone in which this volume was created.

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

Parameters:
availabilityZone Availability zone in which this volume was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }
    
    
    
State of this volume (e.g., creating, available).

Constraints:
Allowed Values: creating, available, in-use, deleting, error

Returns:
State of this volume (e.g., creating, available).
See also:
VolumeState
    public String getState() {
        return ;
    }
    
    
State of this volume (e.g., creating, available).

Constraints:
Allowed Values: creating, available, in-use, deleting, error

Parameters:
state State of this volume (e.g., creating, available).
See also:
VolumeState
    public void setState(String state) {
        this. = state;
    }
    
    
State of this volume (e.g., creating, available).

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

Constraints:
Allowed Values: creating, available, in-use, deleting, error

Parameters:
state State of this volume (e.g., creating, available).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VolumeState
    public Volume withState(String state) {
        this. = state;
        return this;
    }
    
    
    
Timestamp when volume creation was initiated.

Returns:
Timestamp when volume creation was initiated.
    public java.util.Date getCreateTime() {
        return ;
    }
    
    
Timestamp when volume creation was initiated.

Parameters:
createTime Timestamp when volume creation was initiated.
    public void setCreateTime(java.util.Date createTime) {
        this. = createTime;
    }
    
    
Timestamp when volume creation was initiated.

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

Parameters:
createTime Timestamp when volume creation was initiated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withCreateTime(java.util.Date createTime) {
        this. = createTime;
        return this;
    }
    
    
    
Information on what this volume is attached to.

Returns:
Information on what this volume is attached to.
        if ( == null) {
             = new java.util.ArrayList<VolumeAttachment>();
        }
        return ;
    }
    
    
Information on what this volume is attached to.

Parameters:
attachments Information on what this volume is attached to.
    public void setAttachments(java.util.Collection<VolumeAttachmentattachments) {
        java.util.List<VolumeAttachmentattachmentsCopy = new java.util.ArrayList<VolumeAttachment>();
        if (attachments != null) {
            attachmentsCopy.addAll(attachments);
        }
        this. = attachmentsCopy;
    }
    
    
Information on what this volume is attached to.

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

Parameters:
attachments Information on what this volume is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withAttachments(VolumeAttachment... attachments) {
        for (VolumeAttachment value : attachments) {
            getAttachments().add(value);
        }
        return this;
    }
    
    
Information on what this volume is attached to.

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

Parameters:
attachments Information on what this volume is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withAttachments(java.util.Collection<VolumeAttachmentattachments) {
        java.util.List<VolumeAttachmentattachmentsCopy = new java.util.ArrayList<VolumeAttachment>();
        if (attachments != null) {
            attachmentsCopy.addAll(attachments);
        }
        this. = attachmentsCopy;
        return this;
    }
    
    
A list of tags for the Volume.

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

Parameters:
tags A list of tags for the Volume.
    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 Volume.

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

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

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

Parameters:
tags A list of tags for the Volume.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume 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("VolumeId: " +  + ", ");
        sb.append("Size: " +  + ", ");
        sb.append("SnapshotId: " +  + ", ");
        sb.append("AvailabilityZone: " +  + ", ");
        sb.append("State: " +  + ", ");
        sb.append("CreateTime: " +  + ", ");
        sb.append("Attachments: " +  + ", ");
        sb.append("Tags: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X