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

Describes a parameter used to set up an EBS volume in a block device mapping.

 
 public class EbsInstanceBlockDevice implements SerializableCloneable {

    
The ID of the EBS volume.
 
     private String volumeId;

    
The attachment state.

Constraints:
Allowed Values: attaching, attached, detaching, detached

 
     private String status;

    
The time stamp when the attachment initiated.
 
     private java.util.Date attachTime;

    
Indicates whether the volume is deleted on instance termination.
 
     private Boolean deleteOnTermination;

    
The ID of the EBS volume.

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

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

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

Parameters:
volumeId The ID of the EBS volume.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public EbsInstanceBlockDevice withVolumeId(String volumeId) {
         this. = volumeId;
         return this;
     }

    
The attachment state.

Constraints:
Allowed Values: attaching, attached, detaching, detached

Returns:
The attachment state.
See also:
AttachmentStatus
 
     public String getStatus() {
         return ;
     }
    
    
The attachment state.

Constraints:
Allowed Values: attaching, attached, detaching, detached

Parameters:
status The attachment state.
See also:
AttachmentStatus
    public void setStatus(String status) {
        this. = status;
    }
    
    
The attachment state.

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

Constraints:
Allowed Values: attaching, attached, detaching, detached

Parameters:
status The attachment state.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AttachmentStatus
    public EbsInstanceBlockDevice withStatus(String status) {
        this. = status;
        return this;
    }

    
The attachment state.

Constraints:
Allowed Values: attaching, attached, detaching, detached

Parameters:
status The attachment state.
See also:
AttachmentStatus
    public void setStatus(AttachmentStatus status) {
        this. = status.toString();
    }
    
    
The attachment state.

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

Constraints:
Allowed Values: attaching, attached, detaching, detached

Parameters:
status The attachment state.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AttachmentStatus
        this. = status.toString();
        return this;
    }

    
The time stamp when the attachment initiated.

Returns:
The time stamp when the attachment initiated.
    public java.util.Date getAttachTime() {
        return ;
    }
    
    
The time stamp when the attachment initiated.

Parameters:
attachTime The time stamp when the attachment initiated.
    public void setAttachTime(java.util.Date attachTime) {
        this. = attachTime;
    }
    
    
The time stamp when the attachment initiated.

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

Parameters:
attachTime The time stamp when the attachment initiated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EbsInstanceBlockDevice withAttachTime(java.util.Date attachTime) {
        this. = attachTime;
        return this;
    }

    
Indicates whether the volume is deleted on instance termination.

Returns:
Indicates whether the volume is deleted on instance termination.
    public Boolean isDeleteOnTermination() {
        return ;
    }
    
    
Indicates whether the volume is deleted on instance termination.

Parameters:
deleteOnTermination Indicates whether the volume is deleted on instance termination.
    public void setDeleteOnTermination(Boolean deleteOnTermination) {
        this. = deleteOnTermination;
    }
    
    
Indicates whether the volume is deleted on instance termination.

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

Parameters:
deleteOnTermination Indicates whether the volume is deleted on instance termination.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EbsInstanceBlockDevice withDeleteOnTermination(Boolean deleteOnTermination) {
        this. = deleteOnTermination;
        return this;
    }

    
Indicates whether the volume is deleted on instance termination.

Returns:
Indicates whether the volume is deleted on instance termination.
    public Boolean getDeleteOnTermination() {
        return ;
    }

    
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 (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getAttachTime() != nullsb.append("AttachTime: " + getAttachTime() + ",");
        if (isDeleteOnTermination() != nullsb.append("DeleteOnTermination: " + isDeleteOnTermination() );
        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 + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getAttachTime() == null) ? 0 : getAttachTime().hashCode()); 
        hashCode = prime * hashCode + ((isDeleteOnTermination() == null) ? 0 : isDeleteOnTermination().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof EbsInstanceBlockDevice == falsereturn false;
        EbsInstanceBlockDevice other = (EbsInstanceBlockDevice)obj;
        
        if (other.getVolumeId() == null ^ this.getVolumeId() == nullreturn false;
        if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getAttachTime() == null ^ this.getAttachTime() == nullreturn false;
        if (other.getAttachTime() != null && other.getAttachTime().equals(this.getAttachTime()) == falsereturn false
        if (other.isDeleteOnTermination() == null ^ this.isDeleteOnTermination() == nullreturn false;
        if (other.isDeleteOnTermination() != null && other.isDeleteOnTermination().equals(this.isDeleteOnTermination()) == falsereturn false
        return true;
    }
    
    @Override
    public EbsInstanceBlockDevice clone() {
        try {
            return (EbsInstanceBlockDevicesuper.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