Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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 network interface.

 
 public class InstanceNetworkInterface implements Serializable {

    
The ID of the network interface.
 
     private String networkInterfaceId;

    
The ID of the subnet.
 
     private String subnetId;

    
The ID of the VPC.
 
     private String vpcId;

    
The description.
 
     private String description;

    
The ID of the AWS account that created the network interface.
 
     private String ownerId;

    
The status of the network interface.

Constraints:
Allowed Values: available, attaching, in-use, detaching

 
     private String status;

    
The IP address of the network interface within the subnet.
 
     private String privateIpAddress;

    
The private DNS name.
 
     private String privateDnsName;

    
Indicates whether to validate network traffic to or from this network interface.
 
     private Boolean sourceDestCheck;

    
One or more security groups.
 
The network interface attachment.
 
The association information for an Elastic IP associated with the network interface.
 
The private IP addresses associated with the network interface.
 
     private com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress> privateIpAddresses;

    
The ID of the network interface.

Returns:
The ID of the network interface.
    public String getNetworkInterfaceId() {
        return ;
    }
    
    
The ID of the network interface.

Parameters:
networkInterfaceId The ID of the network interface.
    public void setNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
    }
    
    
The ID of the network interface.

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

Parameters:
networkInterfaceId The ID of the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
        return this;
    }

    
The ID of the subnet.

Returns:
The ID of the subnet.
    public String getSubnetId() {
        return ;
    }
    
    
The ID of the subnet.

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

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

Parameters:
subnetId The ID of the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withSubnetId(String subnetId) {
        this. = subnetId;
        return this;
    }

    
The ID of the VPC.

Returns:
The ID of the VPC.
    public String getVpcId() {
        return ;
    }
    
    
The ID of the VPC.

Parameters:
vpcId The ID of the VPC.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
The ID of the VPC.

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

Parameters:
vpcId The ID of the VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
The description.

Returns:
The description.
    public String getDescription() {
        return ;
    }
    
    
The description.

Parameters:
description The description.
    public void setDescription(String description) {
        this. = description;
    }
    
    
The description.

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

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

    
The ID of the AWS account that created the network interface.

Returns:
The ID of the AWS account that created the network interface.
    public String getOwnerId() {
        return ;
    }
    
    
The ID of the AWS account that created the network interface.

Parameters:
ownerId The ID of the AWS account that created the network interface.
    public void setOwnerId(String ownerId) {
        this. = ownerId;
    }
    
    
The ID of the AWS account that created the network interface.

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

Parameters:
ownerId The ID of the AWS account that created the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withOwnerId(String ownerId) {
        this. = ownerId;
        return this;
    }

    
The status of the network interface.

Constraints:
Allowed Values: available, attaching, in-use, detaching

Returns:
The status of the network interface.
See also:
NetworkInterfaceStatus
    public String getStatus() {
        return ;
    }
    
    
The status of the network interface.

Constraints:
Allowed Values: available, attaching, in-use, detaching

Parameters:
status The status of the network interface.
See also:
NetworkInterfaceStatus
    public void setStatus(String status) {
        this. = status;
    }
    
    
The status of the network interface.

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

Constraints:
Allowed Values: available, attaching, in-use, detaching

Parameters:
status The status of the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
NetworkInterfaceStatus
    public InstanceNetworkInterface withStatus(String status) {
        this. = status;
        return this;
    }

    
The status of the network interface.

Constraints:
Allowed Values: available, attaching, in-use, detaching

Parameters:
status The status of the network interface.
See also:
NetworkInterfaceStatus
    public void setStatus(NetworkInterfaceStatus status) {
        this. = status.toString();
    }
    
    
The status of the network interface.

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

Constraints:
Allowed Values: available, attaching, in-use, detaching

Parameters:
status The status of the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
NetworkInterfaceStatus
    public InstanceNetworkInterface withStatus(NetworkInterfaceStatus status) {
        this. = status.toString();
        return this;
    }

    
The IP address of the network interface within the subnet.

Returns:
The IP address of the network interface within the subnet.
    public String getPrivateIpAddress() {
        return ;
    }
    
    
The IP address of the network interface within the subnet.

Parameters:
privateIpAddress The IP address of the network interface within the subnet.
    public void setPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
    }
    
    
The IP address of the network interface within the subnet.

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

Parameters:
privateIpAddress The IP address of the network interface within the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
        return this;
    }

    
The private DNS name.

Returns:
The private DNS name.
    public String getPrivateDnsName() {
        return ;
    }
    
    
The private DNS name.

Parameters:
privateDnsName The private DNS name.
    public void setPrivateDnsName(String privateDnsName) {
        this. = privateDnsName;
    }
    
    
The private DNS name.

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

Parameters:
privateDnsName The private DNS name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withPrivateDnsName(String privateDnsName) {
        this. = privateDnsName;
        return this;
    }

    
Indicates whether to validate network traffic to or from this network interface.

Returns:
Indicates whether to validate network traffic to or from this network interface.
    public Boolean isSourceDestCheck() {
        return ;
    }
    
    
Indicates whether to validate network traffic to or from this network interface.

Parameters:
sourceDestCheck Indicates whether to validate network traffic to or from this network interface.
    public void setSourceDestCheck(Boolean sourceDestCheck) {
        this. = sourceDestCheck;
    }
    
    
Indicates whether to validate network traffic to or from this network interface.

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

Parameters:
sourceDestCheck Indicates whether to validate network traffic to or from this network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withSourceDestCheck(Boolean sourceDestCheck) {
        this. = sourceDestCheck;
        return this;
    }

    
Indicates whether to validate network traffic to or from this network interface.

Returns:
Indicates whether to validate network traffic to or from this network interface.
    public Boolean getSourceDestCheck() {
        return ;
    }

    
One or more security groups.

Returns:
One or more security groups.
    public java.util.List<GroupIdentifiergetGroups() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<GroupIdentifier>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more security groups.

Parameters:
groups One or more security groups.
    public void setGroups(java.util.Collection<GroupIdentifiergroups) {
        if (groups == null) {
            this. = null;
            return;
        }
        groupsCopy.addAll(groups);
        this. = groupsCopy;
    }
    
    
One or more security groups.

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

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

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

Parameters:
groups 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;
    }

    
The network interface attachment.

Returns:
The network interface attachment.
        return ;
    }
    
    
The network interface attachment.

Parameters:
attachment The network interface attachment.
    public void setAttachment(InstanceNetworkInterfaceAttachment attachment) {
        this. = attachment;
    }
    
    
The network interface attachment.

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

Parameters:
attachment The network interface attachment.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = attachment;
        return this;
    }

    
The association information for an Elastic IP associated with the network interface.

Returns:
The association information for an Elastic IP associated with the network interface.
        return ;
    }
    
    
The association information for an Elastic IP associated with the network interface.

Parameters:
association The association information for an Elastic IP associated with the network interface.
    public void setAssociation(InstanceNetworkInterfaceAssociation association) {
        this. = association;
    }
    
    
The association information for an Elastic IP associated with the network interface.

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

Parameters:
association The association information for an Elastic IP associated with the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = association;
        return this;
    }

    
The private IP addresses associated with the network interface.

Returns:
The private IP addresses associated with the network interface.
    public java.util.List<InstancePrivateIpAddress> getPrivateIpAddresses() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The private IP addresses associated with the network interface.

Parameters:
privateIpAddresses The private IP addresses associated with the network interface.
    public void setPrivateIpAddresses(java.util.Collection<InstancePrivateIpAddress> privateIpAddresses) {
        if (privateIpAddresses == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress> privateIpAddressesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress>(privateIpAddresses.size());
        privateIpAddressesCopy.addAll(privateIpAddresses);
        this. = privateIpAddressesCopy;
    }
    
    
The private IP addresses associated with the network interface.

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

Parameters:
privateIpAddresses The private IP addresses associated with the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withPrivateIpAddresses(InstancePrivateIpAddress... privateIpAddresses) {
        if (getPrivateIpAddresses() == nullsetPrivateIpAddresses(new java.util.ArrayList<InstancePrivateIpAddress>(privateIpAddresses.length));
        for (InstancePrivateIpAddress value : privateIpAddresses) {
            getPrivateIpAddresses().add(value);
        }
        return this;
    }
    
    
The private IP addresses associated with the network interface.

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

Parameters:
privateIpAddresses The private IP addresses associated with the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceNetworkInterface withPrivateIpAddresses(java.util.Collection<InstancePrivateIpAddress> privateIpAddresses) {
        if (privateIpAddresses == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress> privateIpAddressesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<InstancePrivateIpAddress>(privateIpAddresses.size());
            privateIpAddressesCopy.addAll(privateIpAddresses);
            this. = privateIpAddressesCopy;
        }
        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 (getNetworkInterfaceId() != nullsb.append("NetworkInterfaceId: " + getNetworkInterfaceId() + ",");
        if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getOwnerId() != nullsb.append("OwnerId: " + getOwnerId() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getPrivateIpAddress() != nullsb.append("PrivateIpAddress: " + getPrivateIpAddress() + ",");
        if (getPrivateDnsName() != nullsb.append("PrivateDnsName: " + getPrivateDnsName() + ",");
        if (isSourceDestCheck() != nullsb.append("SourceDestCheck: " + isSourceDestCheck() + ",");
        if (getGroups() != nullsb.append("Groups: " + getGroups() + ",");
        if (getAttachment() != nullsb.append("Attachment: " + getAttachment() + ",");
        if (getAssociation() != nullsb.append("Association: " + getAssociation() + ",");
        if (getPrivateIpAddresses() != nullsb.append("PrivateIpAddresses: " + getPrivateIpAddresses() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getNetworkInterfaceId() == null) ? 0 : getNetworkInterfaceId().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode()); 
        hashCode = prime * hashCode + ((isSourceDestCheck() == null) ? 0 : isSourceDestCheck().hashCode()); 
        hashCode = prime * hashCode + ((getGroups() == null) ? 0 : getGroups().hashCode()); 
        hashCode = prime * hashCode + ((getAttachment() == null) ? 0 : getAttachment().hashCode()); 
        hashCode = prime * hashCode + ((getAssociation() == null) ? 0 : getAssociation().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddresses() == null) ? 0 : getPrivateIpAddresses().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceNetworkInterface == falsereturn false;
        InstanceNetworkInterface other = (InstanceNetworkInterface)obj;
        
        if (other.getNetworkInterfaceId() == null ^ this.getNetworkInterfaceId() == nullreturn false;
        if (other.getNetworkInterfaceId() != null && other.getNetworkInterfaceId().equals(this.getNetworkInterfaceId()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getOwnerId() == null ^ this.getOwnerId() == nullreturn false;
        if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == nullreturn false;
        if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == falsereturn false
        if (other.getPrivateDnsName() == null ^ this.getPrivateDnsName() == nullreturn false;
        if (other.getPrivateDnsName() != null && other.getPrivateDnsName().equals(this.getPrivateDnsName()) == falsereturn false
        if (other.isSourceDestCheck() == null ^ this.isSourceDestCheck() == nullreturn false;
        if (other.isSourceDestCheck() != null && other.isSourceDestCheck().equals(this.isSourceDestCheck()) == falsereturn false
        if (other.getGroups() == null ^ this.getGroups() == nullreturn false;
        if (other.getGroups() != null && other.getGroups().equals(this.getGroups()) == falsereturn false
        if (other.getAttachment() == null ^ this.getAttachment() == nullreturn false;
        if (other.getAttachment() != null && other.getAttachment().equals(this.getAttachment()) == falsereturn false
        if (other.getAssociation() == null ^ this.getAssociation() == nullreturn false;
        if (other.getAssociation() != null && other.getAssociation().equals(this.getAssociation()) == falsereturn false
        if (other.getPrivateIpAddresses() == null ^ this.getPrivateIpAddresses() == nullreturn false;
        if (other.getPrivateIpAddresses() != null && other.getPrivateIpAddresses().equals(this.getPrivateIpAddresses()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X