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 a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping data type.

 
 public class BlockDeviceMapping implements SerializableCloneable {

    
The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.
 
     private String deviceName;

    
Suppresses the specified device included in the AMI's block device mapping.
 
     private String noDevice;

    
The virtual device name. For more information, see BlockDeviceMapping.
 
     private String virtualName;

    
An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.
 
     private EbsBlockDevice ebs;

    
The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

Returns:
The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.
 
     public String getDeviceName() {
         return ;
     }
    
    
The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

Parameters:
deviceName The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.
 
     public void setDeviceName(String deviceName) {
         this. = deviceName;
     }
    
    
The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

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

Parameters:
deviceName The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BlockDeviceMapping withDeviceName(String deviceName) {
        this. = deviceName;
        return this;
    }

    
Suppresses the specified device included in the AMI's block device mapping.

Returns:
Suppresses the specified device included in the AMI's block device mapping.
    public String getNoDevice() {
        return ;
    }
    
    
Suppresses the specified device included in the AMI's block device mapping.

Parameters:
noDevice Suppresses the specified device included in the AMI's block device mapping.
    public void setNoDevice(String noDevice) {
        this. = noDevice;
    }
    
    
Suppresses the specified device included in the AMI's block device mapping.

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

Parameters:
noDevice Suppresses the specified device included in the AMI's block device mapping.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BlockDeviceMapping withNoDevice(String noDevice) {
        this. = noDevice;
        return this;
    }

    
The virtual device name. For more information, see BlockDeviceMapping.

Returns:
The virtual device name. For more information, see BlockDeviceMapping.
    public String getVirtualName() {
        return ;
    }
    
    
The virtual device name. For more information, see BlockDeviceMapping.

Parameters:
virtualName The virtual device name. For more information, see BlockDeviceMapping.
    public void setVirtualName(String virtualName) {
        this. = virtualName;
    }
    
    
The virtual device name. For more information, see BlockDeviceMapping.

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

Parameters:
virtualName The virtual device name. For more information, see BlockDeviceMapping.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BlockDeviceMapping withVirtualName(String virtualName) {
        this. = virtualName;
        return this;
    }

    
An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

Returns:
An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.
    public EbsBlockDevice getEbs() {
        return ;
    }
    
    
An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

Parameters:
ebs An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.
    public void setEbs(EbsBlockDevice ebs) {
        this. = ebs;
    }
    
    
An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

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

Parameters:
ebs An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BlockDeviceMapping withEbs(EbsBlockDevice ebs) {
        this. = ebs;
        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 (getDeviceName() != nullsb.append("DeviceName: " + getDeviceName() + ",");
        if (getNoDevice() != nullsb.append("NoDevice: " + getNoDevice() + ",");
        if (getVirtualName() != nullsb.append("VirtualName: " + getVirtualName() + ",");
        if (getEbs() != nullsb.append("Ebs: " + getEbs() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); 
        hashCode = prime * hashCode + ((getNoDevice() == null) ? 0 : getNoDevice().hashCode()); 
        hashCode = prime * hashCode + ((getVirtualName() == null) ? 0 : getVirtualName().hashCode()); 
        hashCode = prime * hashCode + ((getEbs() == null) ? 0 : getEbs().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof BlockDeviceMapping == falsereturn false;
        BlockDeviceMapping other = (BlockDeviceMapping)obj;
        
        if (other.getDeviceName() == null ^ this.getDeviceName() == nullreturn false;
        if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == falsereturn false
        if (other.getNoDevice() == null ^ this.getNoDevice() == nullreturn false;
        if (other.getNoDevice() != null && other.getNoDevice().equals(this.getNoDevice()) == falsereturn false
        if (other.getVirtualName() == null ^ this.getVirtualName() == nullreturn false;
        if (other.getVirtualName() != null && other.getVirtualName().equals(this.getVirtualName()) == falsereturn false
        if (other.getEbs() == null ^ this.getEbs() == nullreturn false;
        if (other.getEbs() != null && other.getEbs().equals(this.getEbs()) == falsereturn false
        return true;
    }
    
    @Override
    public BlockDeviceMapping clone() {
        try {
            return (BlockDeviceMappingsuper.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