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

Describes an instance's Amazon EBS volume.

 
 public class Volume implements SerializableCloneable {

    
The volume ID.
 
     private String volumeId;

    
The Amazon EC2 volume ID.
 
     private String ec2VolumeId;

    
The volume name.
 
     private String name;

    
The RAID array ID.
 
     private String raidArrayId;

    
The instance ID.
 
     private String instanceId;

    
The value returned by DescribeVolumes.
 
     private String status;

    
The volume size.
 
     private Integer size;

    
The device name.
 
     private String device;

    
The volume mount point. For example "/dev/sdh".
 
     private String mountPoint;

    
The AWS region. For more information about AWS regions, see Regions and Endpoints.
 
     private String region;

    
The volume Availability Zone. For more information, see Regions and Endpoints.
 
     private String availabilityZone;

    
The volume type, standard or PIOPS.
 
     private String volumeType;

    
For PIOPS volumes, the IOPS per disk.
 
     private Integer iops;

    
The volume ID.

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

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

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

Parameters:
volumeId The volume ID.
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 Amazon EC2 volume ID.

Returns:
The Amazon EC2 volume ID.
    public String getEc2VolumeId() {
        return ;
    }
    
    
The Amazon EC2 volume ID.

Parameters:
ec2VolumeId The Amazon EC2 volume ID.
    public void setEc2VolumeId(String ec2VolumeId) {
        this. = ec2VolumeId;
    }
    
    
The Amazon EC2 volume ID.

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

Parameters:
ec2VolumeId The Amazon EC2 volume ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withEc2VolumeId(String ec2VolumeId) {
        this. = ec2VolumeId;
        return this;
    }

    
The volume name.

Returns:
The volume name.
    public String getName() {
        return ;
    }
    
    
The volume name.

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

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

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

    
The RAID array ID.

Returns:
The RAID array ID.
    public String getRaidArrayId() {
        return ;
    }
    
    
The RAID array ID.

Parameters:
raidArrayId The RAID array ID.
    public void setRaidArrayId(String raidArrayId) {
        this. = raidArrayId;
    }
    
    
The RAID array ID.

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

Parameters:
raidArrayId The RAID array ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withRaidArrayId(String raidArrayId) {
        this. = raidArrayId;
        return this;
    }

    
The instance ID.

Returns:
The instance ID.
    public String getInstanceId() {
        return ;
    }
    
    
The instance ID.

Parameters:
instanceId The instance ID.
    public void setInstanceId(String instanceId) {
        this. = instanceId;
    }
    
    
The instance ID.

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

Parameters:
instanceId The instance ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The value returned by DescribeVolumes.

Returns:
The value returned by DescribeVolumes.
    public String getStatus() {
        return ;
    }
    
    
The value returned by DescribeVolumes.

Parameters:
status The value returned by DescribeVolumes.
    public void setStatus(String status) {
        this. = status;
    }
    
    
The value returned by DescribeVolumes.

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

Parameters:
status The value returned by DescribeVolumes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withStatus(String status) {
        this. = status;
        return this;
    }

    
The volume size.

Returns:
The volume size.
    public Integer getSize() {
        return ;
    }
    
    
The volume size.

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

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

Parameters:
size The volume size.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withSize(Integer size) {
        this. = size;
        return this;
    }

    
The device name.

Returns:
The device name.
    public String getDevice() {
        return ;
    }
    
    
The device name.

Parameters:
device The device name.
    public void setDevice(String device) {
        this. = device;
    }
    
    
The device name.

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

Parameters:
device The device name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withDevice(String device) {
        this. = device;
        return this;
    }

    
The volume mount point. For example "/dev/sdh".

Returns:
The volume mount point. For example "/dev/sdh".
    public String getMountPoint() {
        return ;
    }
    
    
The volume mount point. For example "/dev/sdh".

Parameters:
mountPoint The volume mount point. For example "/dev/sdh".
    public void setMountPoint(String mountPoint) {
        this. = mountPoint;
    }
    
    
The volume mount point. For example "/dev/sdh".

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

Parameters:
mountPoint The volume mount point. For example "/dev/sdh".
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withMountPoint(String mountPoint) {
        this. = mountPoint;
        return this;
    }

    
The AWS region. For more information about AWS regions, see Regions and Endpoints.

Returns:
The AWS region. For more information about AWS regions, see Regions and Endpoints.
    public String getRegion() {
        return ;
    }
    
    
The AWS region. For more information about AWS regions, see Regions and Endpoints.

Parameters:
region The AWS region. For more information about AWS regions, see Regions and Endpoints.
    public void setRegion(String region) {
        this. = region;
    }
    
    
The AWS region. For more information about AWS regions, see Regions and Endpoints.

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

Parameters:
region The AWS region. For more information about AWS regions, see Regions and Endpoints.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withRegion(String region) {
        this. = region;
        return this;
    }

    
The volume Availability Zone. For more information, see Regions and Endpoints.

Returns:
The volume Availability Zone. For more information, see Regions and Endpoints.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The volume Availability Zone. For more information, see Regions and Endpoints.

Parameters:
availabilityZone The volume Availability Zone. For more information, see Regions and Endpoints.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The volume Availability Zone. For more information, see Regions and Endpoints.

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

Parameters:
availabilityZone The volume Availability Zone. For more information, see Regions and Endpoints.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }

    
The volume type, standard or PIOPS.

Returns:
The volume type, standard or PIOPS.
    public String getVolumeType() {
        return ;
    }
    
    
The volume type, standard or PIOPS.

Parameters:
volumeType The volume type, standard or PIOPS.
    public void setVolumeType(String volumeType) {
        this. = volumeType;
    }
    
    
The volume type, standard or PIOPS.

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

Parameters:
volumeType The volume type, standard or PIOPS.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume withVolumeType(String volumeType) {
        this. = volumeType;
        return this;
    }

    
For PIOPS volumes, the IOPS per disk.

Returns:
For PIOPS volumes, the IOPS per disk.
    public Integer getIops() {
        return ;
    }
    
    
For PIOPS volumes, the IOPS per disk.

Parameters:
iops For PIOPS volumes, the IOPS per disk.
    public void setIops(Integer iops) {
        this. = iops;
    }
    
    
For PIOPS volumes, the IOPS per disk.

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

Parameters:
iops For PIOPS volumes, the IOPS per disk.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Volume 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 (getVolumeId() != nullsb.append("VolumeId: " + getVolumeId() + ",");
        if (getEc2VolumeId() != nullsb.append("Ec2VolumeId: " + getEc2VolumeId() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getRaidArrayId() != nullsb.append("RaidArrayId: " + getRaidArrayId() + ",");
        if (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getSize() != nullsb.append("Size: " + getSize() + ",");
        if (getDevice() != nullsb.append("Device: " + getDevice() + ",");
        if (getMountPoint() != nullsb.append("MountPoint: " + getMountPoint() + ",");
        if (getRegion() != nullsb.append("Region: " + getRegion() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getVolumeType() != nullsb.append("VolumeType: " + getVolumeType() + ",");
        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 + ((getVolumeId() == null) ? 0 : getVolumeId().hashCode()); 
        hashCode = prime * hashCode + ((getEc2VolumeId() == null) ? 0 : getEc2VolumeId().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getRaidArrayId() == null) ? 0 : getRaidArrayId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getSize() == null) ? 0 : getSize().hashCode()); 
        hashCode = prime * hashCode + ((getDevice() == null) ? 0 : getDevice().hashCode()); 
        hashCode = prime * hashCode + ((getMountPoint() == null) ? 0 : getMountPoint().hashCode()); 
        hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getVolumeType() == null) ? 0 : getVolumeType().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 Volume == falsereturn false;
        Volume other = (Volume)obj;
        
        if (other.getVolumeId() == null ^ this.getVolumeId() == nullreturn false;
        if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == falsereturn false
        if (other.getEc2VolumeId() == null ^ this.getEc2VolumeId() == nullreturn false;
        if (other.getEc2VolumeId() != null && other.getEc2VolumeId().equals(this.getEc2VolumeId()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getRaidArrayId() == null ^ this.getRaidArrayId() == nullreturn false;
        if (other.getRaidArrayId() != null && other.getRaidArrayId().equals(this.getRaidArrayId()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getSize() == null ^ this.getSize() == nullreturn false;
        if (other.getSize() != null && other.getSize().equals(this.getSize()) == falsereturn false
        if (other.getDevice() == null ^ this.getDevice() == nullreturn false;
        if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == falsereturn false
        if (other.getMountPoint() == null ^ this.getMountPoint() == nullreturn false;
        if (other.getMountPoint() != null && other.getMountPoint().equals(this.getMountPoint()) == falsereturn false
        if (other.getRegion() == null ^ this.getRegion() == nullreturn false;
        if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        if (other.getVolumeType() == null ^ this.getVolumeType() == nullreturn false;
        if (other.getVolumeType() != null && other.getVolumeType().equals(this.getVolumeType()) == 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 Volume clone() {
        try {
            return (Volumesuper.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