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.autoscaling.model;
 

Describes an Amazon EBS volume.

 
 public class Ebs implements SerializableCloneable {

    
The ID of the snapshot.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String snapshotId;

    
The volume size, in gigabytes.

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

Constraints:
Range: 1 - 16384

 
     private Integer volumeSize;

    
The volume type.

Valid values: standard | io1 | gp2

Default: standard

Constraints:
Length: 1 - 255

 
     private String volumeType;

    
Indicates whether to delete the volume on instance termination.

Default: true

 
     private Boolean deleteOnTermination;

    
For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

Constraints:
Range: 100 - 30000

 
     private Integer iops;

    
The ID of the snapshot.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

    
The volume size, in gigabytes.

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

Constraints:
Range: 1 - 16384

Returns:
The volume size, in gigabytes.

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

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

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

Constraints:
Range: 1 - 16384

Parameters:
volumeSize The volume size, in gigabytes.

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

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

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

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

Constraints:
Range: 1 - 16384

Parameters:
volumeSize The volume size, in gigabytes.

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

Required: Required when the volume type is io1.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Ebs withVolumeSize(Integer volumeSize) {
        this. = volumeSize;
        return this;
    }

    
The volume type.

Valid values: standard | io1 | gp2

Default: standard

Constraints:
Length: 1 - 255

Returns:
The volume type.

Valid values: standard | io1 | gp2

Default: standard

    public String getVolumeType() {
        return ;
    }
    
    
The volume type.

Valid values: standard | io1 | gp2

Default: standard

Constraints:
Length: 1 - 255

Parameters:
volumeType The volume type.

Valid values: standard | io1 | gp2

Default: standard

    public void setVolumeType(String volumeType) {
        this. = volumeType;
    }
    
    
The volume type.

Valid values: standard | io1 | gp2

Default: standard

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

Constraints:
Length: 1 - 255

Parameters:
volumeType The volume type.

Valid values: standard | io1 | gp2

Default: standard

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

    
Indicates whether to delete the volume on instance termination.

Default: true

Returns:
Indicates whether to delete the volume on instance termination.

Default: true

    public Boolean isDeleteOnTermination() {
        return ;
    }
    
    
Indicates whether to delete the volume on instance termination.

Default: true

Parameters:
deleteOnTermination Indicates whether to delete the volume on instance termination.

Default: true

    public void setDeleteOnTermination(Boolean deleteOnTermination) {
        this. = deleteOnTermination;
    }
    
    
Indicates whether to delete the volume on instance termination.

Default: true

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

Parameters:
deleteOnTermination Indicates whether to delete the volume on instance termination.

Default: true

Returns:
A reference to this updated object so that method calls can be chained together.
    public Ebs withDeleteOnTermination(Boolean deleteOnTermination) {
        this. = deleteOnTermination;
        return this;
    }

    
Indicates whether to delete the volume on instance termination.

Default: true

Returns:
Indicates whether to delete the volume on instance termination.

Default: true

    public Boolean getDeleteOnTermination() {
        return ;
    }

    
For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

Constraints:
Range: 100 - 30000

Returns:
For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

    public Integer getIops() {
        return ;
    }
    
    
For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

Constraints:
Range: 100 - 30000

Parameters:
iops For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

    public void setIops(Integer iops) {
        this. = iops;
    }
    
    
For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

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

Constraints:
Range: 100 - 30000

Parameters:
iops For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

Valid values: Range is 100 to 4000.

Default: None

Returns:
A reference to this updated object so that method calls can be chained together.
    public Ebs withIops(Integer iops) {
        this. = iops;
        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 (getSnapshotId() != nullsb.append("SnapshotId: " + getSnapshotId() + ",");
        if (getVolumeSize() != nullsb.append("VolumeSize: " + getVolumeSize() + ",");
        if (getVolumeType() != nullsb.append("VolumeType: " + getVolumeType() + ",");
        if (isDeleteOnTermination() != nullsb.append("DeleteOnTermination: " + isDeleteOnTermination() + ",");
        if (getIops() != nullsb.append("Iops: " + getIops() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode()); 
        hashCode = prime * hashCode + ((getVolumeSize() == null) ? 0 : getVolumeSize().hashCode()); 
        hashCode = prime * hashCode + ((getVolumeType() == null) ? 0 : getVolumeType().hashCode()); 
        hashCode = prime * hashCode + ((isDeleteOnTermination() == null) ? 0 : isDeleteOnTermination().hashCode()); 
        hashCode = prime * hashCode + ((getIops() == null) ? 0 : getIops().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Ebs == falsereturn false;
        Ebs other = (Ebs)obj;
        
        if (other.getSnapshotId() == null ^ this.getSnapshotId() == nullreturn false;
        if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == falsereturn false
        if (other.getVolumeSize() == null ^ this.getVolumeSize() == nullreturn false;
        if (other.getVolumeSize() != null && other.getVolumeSize().equals(this.getVolumeSize()) == falsereturn false
        if (other.getVolumeType() == null ^ this.getVolumeType() == nullreturn false;
        if (other.getVolumeType() != null && other.getVolumeType().equals(this.getVolumeType()) == falsereturn false
        if (other.isDeleteOnTermination() == null ^ this.isDeleteOnTermination() == nullreturn false;
        if (other.isDeleteOnTermination() != null && other.isDeleteOnTermination().equals(this.isDeleteOnTermination()) == falsereturn false
        if (other.getIops() == null ^ this.getIops() == nullreturn false;
        if (other.getIops() != null && other.getIops().equals(this.getIops()) == falsereturn false
        return true;
    }
    
    @Override
    public Ebs clone() {
        try {
            return (Ebssuper.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