/* * Copyright 2018-2023 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; import java.io.Serializable; import javax.annotation.Generated; /** *
* Describes a network interface. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InstanceNetworkInterface implements Serializable, Cloneable { /** ** The association information for an Elastic IPv4 associated with the network interface. *
*/ private InstanceNetworkInterfaceAssociation association; /** ** The network interface attachment. *
*/ private InstanceNetworkInterfaceAttachment attachment; /** ** The description. *
*/ private String description; /** ** The security groups. *
*/ private com.amazonaws.internal.SdkInternalList* The IPv6 addresses associated with the network interface. *
*/ private com.amazonaws.internal.SdkInternalList* The MAC address. *
*/ private String macAddress; /** ** The ID of the network interface. *
*/ private String networkInterfaceId; /** ** The ID of the Amazon Web Services account that created the network interface. *
*/ private String ownerId; /** ** The private DNS name. *
*/ private String privateDnsName; /** ** The IPv4 address of the network interface within the subnet. *
*/ private String privateIpAddress; /** ** The private IPv4 addresses associated with the network interface. *
*/ private com.amazonaws.internal.SdkInternalList* Indicates whether source/destination checking is enabled. *
*/ private Boolean sourceDestCheck; /** ** The status of the network interface. *
*/ private String status; /** ** The ID of the subnet. *
*/ private String subnetId; /** ** The ID of the VPC. *
*/ private String vpcId; /** ** The type of network interface. *
*
* Valid values: interface
| efa
| trunk
*
* The IPv4 delegated prefixes that are assigned to the network interface. *
*/ private com.amazonaws.internal.SdkInternalList* The IPv6 delegated prefixes that are assigned to the network interface. *
*/ private com.amazonaws.internal.SdkInternalList* The association information for an Elastic IPv4 associated with the network interface. *
* * @param association * The association information for an Elastic IPv4 associated with the network interface. */ public void setAssociation(InstanceNetworkInterfaceAssociation association) { this.association = association; } /** ** The association information for an Elastic IPv4 associated with the network interface. *
* * @return The association information for an Elastic IPv4 associated with the network interface. */ public InstanceNetworkInterfaceAssociation getAssociation() { return this.association; } /** ** The association information for an Elastic IPv4 associated with the network interface. *
* * @param association * The association information for an Elastic IPv4 associated with the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withAssociation(InstanceNetworkInterfaceAssociation association) { setAssociation(association); return this; } /** ** The network interface attachment. *
* * @param attachment * The network interface attachment. */ public void setAttachment(InstanceNetworkInterfaceAttachment attachment) { this.attachment = attachment; } /** ** The network interface attachment. *
* * @return The network interface attachment. */ public InstanceNetworkInterfaceAttachment getAttachment() { return this.attachment; } /** ** The network interface attachment. *
* * @param attachment * The network interface attachment. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withAttachment(InstanceNetworkInterfaceAttachment attachment) { setAttachment(attachment); return this; } /** ** The description. *
* * @param description * The description. */ public void setDescription(String description) { this.description = description; } /** ** The description. *
* * @return The description. */ public String getDescription() { return this.description; } /** ** The description. *
* * @param description * The description. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withDescription(String description) { setDescription(description); return this; } /** ** The security groups. *
* * @return The security groups. */ public java.util.List* The security groups. *
* * @param groups * The security groups. */ public void setGroups(java.util.Collection* The security groups. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setGroups(java.util.Collection)} or {@link #withGroups(java.util.Collection)} if you want to override the * existing values. *
* * @param groups * The security groups. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withGroups(GroupIdentifier... groups) { if (this.groups == null) { setGroups(new com.amazonaws.internal.SdkInternalList* The security groups. *
* * @param groups * The security groups. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withGroups(java.util.Collection* The IPv6 addresses associated with the network interface. *
* * @return The IPv6 addresses associated with the network interface. */ public java.util.List* The IPv6 addresses associated with the network interface. *
* * @param ipv6Addresses * The IPv6 addresses associated with the network interface. */ public void setIpv6Addresses(java.util.Collection* The IPv6 addresses associated with the network interface. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setIpv6Addresses(java.util.Collection)} or {@link #withIpv6Addresses(java.util.Collection)} if you want * to override the existing values. *
* * @param ipv6Addresses * The IPv6 addresses associated with the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv6Addresses(InstanceIpv6Address... ipv6Addresses) { if (this.ipv6Addresses == null) { setIpv6Addresses(new com.amazonaws.internal.SdkInternalList* The IPv6 addresses associated with the network interface. *
* * @param ipv6Addresses * The IPv6 addresses associated with the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv6Addresses(java.util.Collection* The MAC address. *
* * @param macAddress * The MAC address. */ public void setMacAddress(String macAddress) { this.macAddress = macAddress; } /** ** The MAC address. *
* * @return The MAC address. */ public String getMacAddress() { return this.macAddress; } /** ** The MAC address. *
* * @param macAddress * The MAC address. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withMacAddress(String macAddress) { setMacAddress(macAddress); return this; } /** ** The ID of the network interface. *
* * @param networkInterfaceId * The ID of the network interface. */ public void setNetworkInterfaceId(String networkInterfaceId) { this.networkInterfaceId = networkInterfaceId; } /** ** The ID of the network interface. *
* * @return The ID of the network interface. */ public String getNetworkInterfaceId() { return this.networkInterfaceId; } /** ** The ID of the network interface. *
* * @param networkInterfaceId * The ID of the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withNetworkInterfaceId(String networkInterfaceId) { setNetworkInterfaceId(networkInterfaceId); return this; } /** ** The ID of the Amazon Web Services account that created the network interface. *
* * @param ownerId * The ID of the Amazon Web Services account that created the network interface. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** ** The ID of the Amazon Web Services account that created the network interface. *
* * @return The ID of the Amazon Web Services account that created the network interface. */ public String getOwnerId() { return this.ownerId; } /** ** The ID of the Amazon Web Services account that created the network interface. *
* * @param ownerId * The ID of the Amazon Web Services account that created the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withOwnerId(String ownerId) { setOwnerId(ownerId); return this; } /** ** The private DNS name. *
* * @param privateDnsName * The private DNS name. */ public void setPrivateDnsName(String privateDnsName) { this.privateDnsName = privateDnsName; } /** ** The private DNS name. *
* * @return The private DNS name. */ public String getPrivateDnsName() { return this.privateDnsName; } /** ** The private DNS name. *
* * @param privateDnsName * The private DNS name. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withPrivateDnsName(String privateDnsName) { setPrivateDnsName(privateDnsName); return this; } /** ** The IPv4 address of the network interface within the subnet. *
* * @param privateIpAddress * The IPv4 address of the network interface within the subnet. */ public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; } /** ** The IPv4 address of the network interface within the subnet. *
* * @return The IPv4 address of the network interface within the subnet. */ public String getPrivateIpAddress() { return this.privateIpAddress; } /** ** The IPv4 address of the network interface within the subnet. *
* * @param privateIpAddress * The IPv4 address of the network interface within the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withPrivateIpAddress(String privateIpAddress) { setPrivateIpAddress(privateIpAddress); return this; } /** ** The private IPv4 addresses associated with the network interface. *
* * @return The private IPv4 addresses associated with the network interface. */ public java.util.List* The private IPv4 addresses associated with the network interface. *
* * @param privateIpAddresses * The private IPv4 addresses associated with the network interface. */ public void setPrivateIpAddresses(java.util.Collection* The private IPv4 addresses associated with the network interface. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setPrivateIpAddresses(java.util.Collection)} or {@link #withPrivateIpAddresses(java.util.Collection)} if * you want to override the existing values. *
* * @param privateIpAddresses * The private IPv4 addresses associated with the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withPrivateIpAddresses(InstancePrivateIpAddress... privateIpAddresses) { if (this.privateIpAddresses == null) { setPrivateIpAddresses(new com.amazonaws.internal.SdkInternalList* The private IPv4 addresses associated with the network interface. *
* * @param privateIpAddresses * The private IPv4 addresses associated with the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withPrivateIpAddresses(java.util.Collection* Indicates whether source/destination checking is enabled. *
* * @param sourceDestCheck * Indicates whether source/destination checking is enabled. */ public void setSourceDestCheck(Boolean sourceDestCheck) { this.sourceDestCheck = sourceDestCheck; } /** ** Indicates whether source/destination checking is enabled. *
* * @return Indicates whether source/destination checking is enabled. */ public Boolean getSourceDestCheck() { return this.sourceDestCheck; } /** ** Indicates whether source/destination checking is enabled. *
* * @param sourceDestCheck * Indicates whether source/destination checking is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withSourceDestCheck(Boolean sourceDestCheck) { setSourceDestCheck(sourceDestCheck); return this; } /** ** Indicates whether source/destination checking is enabled. *
* * @return Indicates whether source/destination checking is enabled. */ public Boolean isSourceDestCheck() { return this.sourceDestCheck; } /** ** The status of the network interface. *
* * @param status * The status of the network interface. * @see NetworkInterfaceStatus */ public void setStatus(String status) { this.status = status; } /** ** The status of the network interface. *
* * @return The status of the network interface. * @see NetworkInterfaceStatus */ public String getStatus() { return this.status; } /** ** The status of the network interface. *
* * @param status * The status of the network interface. * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkInterfaceStatus */ public InstanceNetworkInterface withStatus(String status) { setStatus(status); return this; } /** ** The status of the network interface. *
* * @param status * The status of the network interface. * @see NetworkInterfaceStatus */ public void setStatus(NetworkInterfaceStatus status) { withStatus(status); } /** ** The status of the network interface. *
* * @param status * The status of the network interface. * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkInterfaceStatus */ public InstanceNetworkInterface withStatus(NetworkInterfaceStatus status) { this.status = status.toString(); return this; } /** ** The ID of the subnet. *
* * @param subnetId * The ID of the subnet. */ public void setSubnetId(String subnetId) { this.subnetId = subnetId; } /** ** The ID of the subnet. *
* * @return The ID of the subnet. */ public String getSubnetId() { return this.subnetId; } /** ** The ID of the subnet. *
* * @param subnetId * The ID of the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withSubnetId(String subnetId) { setSubnetId(subnetId); return this; } /** ** The ID of the VPC. *
* * @param vpcId * The ID of the VPC. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** ** The ID of the VPC. *
* * @return The ID of the VPC. */ public String getVpcId() { return this.vpcId; } /** ** The ID of the VPC. *
* * @param vpcId * The ID of the VPC. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withVpcId(String vpcId) { setVpcId(vpcId); return this; } /** ** The type of network interface. *
*
* Valid values: interface
| efa
| trunk
*
* Valid values: interface
| efa
| trunk
*/
public void setInterfaceType(String interfaceType) {
this.interfaceType = interfaceType;
}
/**
*
* The type of network interface. *
*
* Valid values: interface
| efa
| trunk
*
* Valid values: interface
| efa
| trunk
*/
public String getInterfaceType() {
return this.interfaceType;
}
/**
*
* The type of network interface. *
*
* Valid values: interface
| efa
| trunk
*
* Valid values: interface
| efa
| trunk
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceNetworkInterface withInterfaceType(String interfaceType) {
setInterfaceType(interfaceType);
return this;
}
/**
*
* The IPv4 delegated prefixes that are assigned to the network interface. *
* * @return The IPv4 delegated prefixes that are assigned to the network interface. */ public java.util.List* The IPv4 delegated prefixes that are assigned to the network interface. *
* * @param ipv4Prefixes * The IPv4 delegated prefixes that are assigned to the network interface. */ public void setIpv4Prefixes(java.util.Collection* The IPv4 delegated prefixes that are assigned to the network interface. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setIpv4Prefixes(java.util.Collection)} or {@link #withIpv4Prefixes(java.util.Collection)} if you want to * override the existing values. *
* * @param ipv4Prefixes * The IPv4 delegated prefixes that are assigned to the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv4Prefixes(InstanceIpv4Prefix... ipv4Prefixes) { if (this.ipv4Prefixes == null) { setIpv4Prefixes(new com.amazonaws.internal.SdkInternalList* The IPv4 delegated prefixes that are assigned to the network interface. *
* * @param ipv4Prefixes * The IPv4 delegated prefixes that are assigned to the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv4Prefixes(java.util.Collection* The IPv6 delegated prefixes that are assigned to the network interface. *
* * @return The IPv6 delegated prefixes that are assigned to the network interface. */ public java.util.List* The IPv6 delegated prefixes that are assigned to the network interface. *
* * @param ipv6Prefixes * The IPv6 delegated prefixes that are assigned to the network interface. */ public void setIpv6Prefixes(java.util.Collection* The IPv6 delegated prefixes that are assigned to the network interface. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setIpv6Prefixes(java.util.Collection)} or {@link #withIpv6Prefixes(java.util.Collection)} if you want to * override the existing values. *
* * @param ipv6Prefixes * The IPv6 delegated prefixes that are assigned to the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv6Prefixes(InstanceIpv6Prefix... ipv6Prefixes) { if (this.ipv6Prefixes == null) { setIpv6Prefixes(new com.amazonaws.internal.SdkInternalList* The IPv6 delegated prefixes that are assigned to the network interface. *
* * @param ipv6Prefixes * The IPv6 delegated prefixes that are assigned to the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceNetworkInterface withIpv6Prefixes(java.util.Collection