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;
 
 
Container for the parameters to the CreateNetworkInterface operation.

Creates a network interface in the specified subnet.

For more information about network interfaces, see Elastic Network Interfaces in the Amazon Elastic Compute Cloud User Guide .

 
The ID of the subnet to associate with the network interface.
 
     private String subnetId;

    
A description for the network interface.
 
     private String description;

    
The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).
 
     private String privateIpAddress;

    
The IDs of one or more security groups.
 
One or more private IP addresses.
 
The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

 
     private Integer secondaryPrivateIpAddressCount;

    
The ID of the subnet to associate with the network interface.

Returns:
The ID of the subnet to associate with the network interface.
 
     public String getSubnetId() {
         return ;
     }
    
    
The ID of the subnet to associate with the network interface.

Parameters:
subnetId The ID of the subnet to associate with the network interface.
 
     public void setSubnetId(String subnetId) {
         this. = subnetId;
     }
    
    
The ID of the subnet to associate with the network interface.

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

Parameters:
subnetId The ID of the subnet to associate with the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = subnetId;
        return this;
    }

    
A description for the network interface.

Returns:
A description for the network interface.
    public String getDescription() {
        return ;
    }
    
    
A description for the network interface.

Parameters:
description A description for the network interface.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description for the network interface.

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

Parameters:
description A description for the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateNetworkInterfaceRequest withDescription(String description) {
        this. = description;
        return this;
    }

    
The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

Returns:
The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).
    public String getPrivateIpAddress() {
        return ;
    }
    
    
The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

Parameters:
privateIpAddress The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).
    public void setPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
    }
    
    
The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

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

Parameters:
privateIpAddress The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateNetworkInterfaceRequest withPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
        return this;
    }

    
The IDs of one or more security groups.

Returns:
The IDs of one or more security groups.
    public java.util.List<StringgetGroups() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The IDs of one or more security groups.

Parameters:
groups The IDs of one or more security groups.
    public void setGroups(java.util.Collection<Stringgroups) {
        if (groups == null) {
            this. = null;
            return;
        }
        groupsCopy.addAll(groups);
        this. = groupsCopy;
    }
    
    
The IDs of one or more security groups.

NOTE: This method appends the values to the existing list (if any). Use setGroups(java.util.Collection) or withGroups(java.util.Collection) if you want to override the existing values.

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

Parameters:
groups The IDs of one or more security groups.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateNetworkInterfaceRequest withGroups(String... groups) {
        if (getGroups() == nullsetGroups(new java.util.ArrayList<String>(groups.length));
        for (String value : groups) {
            getGroups().add(value);
        }
        return this;
    }
    
    
The IDs of one or more security groups.

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

Parameters:
groups The IDs of one or more security groups.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (groups == null) {
            this. = null;
        } else {
            groupsCopy.addAll(groups);
            this. = groupsCopy;
        }
        return this;
    }

    
One or more private IP addresses.

Returns:
One or more private IP addresses.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more private IP addresses.

Parameters:
privateIpAddresses One or more private IP addresses.
    public void setPrivateIpAddresses(java.util.Collection<PrivateIpAddressSpecificationprivateIpAddresses) {
        if (privateIpAddresses == null) {
            this. = null;
            return;
        }
        privateIpAddressesCopy.addAll(privateIpAddresses);
        this. = privateIpAddressesCopy;
    }
    
    
One or more private IP addresses.

NOTE: This method appends the values to the existing list (if any). Use setPrivateIpAddresses(java.util.Collection) or withPrivateIpAddresses(java.util.Collection) if you want to override the existing values.

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

Parameters:
privateIpAddresses One or more private IP addresses.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getPrivateIpAddresses() == nullsetPrivateIpAddresses(new java.util.ArrayList<PrivateIpAddressSpecification>(privateIpAddresses.length));
        for (PrivateIpAddressSpecification value : privateIpAddresses) {
            getPrivateIpAddresses().add(value);
        }
        return this;
    }
    
    
One or more private IP addresses.

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

Parameters:
privateIpAddresses One or more private IP addresses.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (privateIpAddresses == null) {
            this. = null;
        } else {
            privateIpAddressesCopy.addAll(privateIpAddresses);
            this. = privateIpAddressesCopy;
        }
        return this;
    }

    
The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

Returns:
The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

        return ;
    }
    
    
The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

Parameters:
secondaryPrivateIpAddressCount The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

    public void setSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount) {
        this. = secondaryPrivateIpAddressCount;
    }
    
    
The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

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

Parameters:
secondaryPrivateIpAddressCount The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet range. You can't specify this option and specify more than one private IP address using privateIpAddresses.

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

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

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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 (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getPrivateIpAddress() != nullsb.append("PrivateIpAddress: " + getPrivateIpAddress() + ",");
        if (getGroups() != nullsb.append("Groups: " + getGroups() + ",");
        if (getPrivateIpAddresses() != nullsb.append("PrivateIpAddresses: " + getPrivateIpAddresses() + ",");
        if (getSecondaryPrivateIpAddressCount() != nullsb.append("SecondaryPrivateIpAddressCount: " + getSecondaryPrivateIpAddressCount() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode()); 
        hashCode = prime * hashCode + ((getGroups() == null) ? 0 : getGroups().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddresses() == null) ? 0 : getPrivateIpAddresses().hashCode()); 
        hashCode = prime * hashCode + ((getSecondaryPrivateIpAddressCount() == null) ? 0 : getSecondaryPrivateIpAddressCount().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateNetworkInterfaceRequest == falsereturn false;
        
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == nullreturn false;
        if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == falsereturn false
        if (other.getGroups() == null ^ this.getGroups() == nullreturn false;
        if (other.getGroups() != null && other.getGroups().equals(this.getGroups()) == falsereturn false
        if (other.getPrivateIpAddresses() == null ^ this.getPrivateIpAddresses() == nullreturn false;
        if (other.getPrivateIpAddresses() != null && other.getPrivateIpAddresses().equals(this.getPrivateIpAddresses()) == falsereturn false
        if (other.getSecondaryPrivateIpAddressCount() == null ^ this.getSecondaryPrivateIpAddressCount() == nullreturn false;
        if (other.getSecondaryPrivateIpAddressCount() != null && other.getSecondaryPrivateIpAddressCount().equals(this.getSecondaryPrivateIpAddressCount()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreateNetworkInterfaceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X