Class Subnet
- java.lang.Object
-
- com.amazonaws.services.ec2.model.Subnet
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Subnet extends Object implements Serializable, Cloneable
Describes a subnet.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Subnet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subnetclone()booleanequals(Object obj)StringgetAvailabilityZone()The Availability Zone of the subnet.IntegergetAvailableIpAddressCount()The number of unused IP addresses in the subnet.StringgetCidrBlock()The CIDR block assigned to the subnet.BooleangetDefaultForAz()Indicates whether this is the default subnet for the Availability Zone.BooleangetMapPublicIpOnLaunch()Indicates whether instances launched in this subnet receive a public IP address.StringgetState()The current state of the subnet.StringgetSubnetId()The ID of the subnet.List<Tag>getTags()Any tags assigned to the subnet.StringgetVpcId()The ID of the VPC the subnet is in.inthashCode()BooleanisDefaultForAz()Indicates whether this is the default subnet for the Availability Zone.BooleanisMapPublicIpOnLaunch()Indicates whether instances launched in this subnet receive a public IP address.voidsetAvailabilityZone(String availabilityZone)The Availability Zone of the subnet.voidsetAvailableIpAddressCount(Integer availableIpAddressCount)The number of unused IP addresses in the subnet.voidsetCidrBlock(String cidrBlock)The CIDR block assigned to the subnet.voidsetDefaultForAz(Boolean defaultForAz)Indicates whether this is the default subnet for the Availability Zone.voidsetMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)Indicates whether instances launched in this subnet receive a public IP address.voidsetState(SubnetState state)The current state of the subnet.voidsetState(String state)The current state of the subnet.voidsetSubnetId(String subnetId)The ID of the subnet.voidsetTags(Collection<Tag> tags)Any tags assigned to the subnet.voidsetVpcId(String vpcId)The ID of the VPC the subnet is in.StringtoString()Returns a string representation of this object; useful for testing and debugging.SubnetwithAvailabilityZone(String availabilityZone)The Availability Zone of the subnet.SubnetwithAvailableIpAddressCount(Integer availableIpAddressCount)The number of unused IP addresses in the subnet.SubnetwithCidrBlock(String cidrBlock)The CIDR block assigned to the subnet.SubnetwithDefaultForAz(Boolean defaultForAz)Indicates whether this is the default subnet for the Availability Zone.SubnetwithMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)Indicates whether instances launched in this subnet receive a public IP address.SubnetwithState(SubnetState state)The current state of the subnet.SubnetwithState(String state)The current state of the subnet.SubnetwithSubnetId(String subnetId)The ID of the subnet.SubnetwithTags(Tag... tags)Any tags assigned to the subnet.SubnetwithTags(Collection<Tag> tags)Any tags assigned to the subnet.SubnetwithVpcId(String vpcId)The ID of the VPC the subnet is in.
-
-
-
Method Detail
-
setSubnetId
public void setSubnetId(String subnetId)
The ID of the subnet.
- Parameters:
subnetId- The ID of the subnet.
-
getSubnetId
public String getSubnetId()
The ID of the subnet.
- Returns:
- The ID of the subnet.
-
withSubnetId
public Subnet withSubnetId(String subnetId)
The ID of the subnet.
- Parameters:
subnetId- The ID of the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setState
public void setState(String state)
The current state of the subnet.
- Parameters:
state- The current state of the subnet.- See Also:
SubnetState
-
getState
public String getState()
The current state of the subnet.
- Returns:
- The current state of the subnet.
- See Also:
SubnetState
-
withState
public Subnet withState(String state)
The current state of the subnet.
- Parameters:
state- The current state of the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
SubnetState
-
setState
public void setState(SubnetState state)
The current state of the subnet.
- Parameters:
state- The current state of the subnet.- See Also:
SubnetState
-
withState
public Subnet withState(SubnetState state)
The current state of the subnet.
- Parameters:
state- The current state of the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
SubnetState
-
setVpcId
public void setVpcId(String vpcId)
The ID of the VPC the subnet is in.
- Parameters:
vpcId- The ID of the VPC the subnet is in.
-
getVpcId
public String getVpcId()
The ID of the VPC the subnet is in.
- Returns:
- The ID of the VPC the subnet is in.
-
withVpcId
public Subnet withVpcId(String vpcId)
The ID of the VPC the subnet is in.
- Parameters:
vpcId- The ID of the VPC the subnet is in.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCidrBlock
public void setCidrBlock(String cidrBlock)
The CIDR block assigned to the subnet.
- Parameters:
cidrBlock- The CIDR block assigned to the subnet.
-
getCidrBlock
public String getCidrBlock()
The CIDR block assigned to the subnet.
- Returns:
- The CIDR block assigned to the subnet.
-
withCidrBlock
public Subnet withCidrBlock(String cidrBlock)
The CIDR block assigned to the subnet.
- Parameters:
cidrBlock- The CIDR block assigned to the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAvailableIpAddressCount
public void setAvailableIpAddressCount(Integer availableIpAddressCount)
The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.
- Parameters:
availableIpAddressCount- The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.
-
getAvailableIpAddressCount
public Integer getAvailableIpAddressCount()
The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.
- Returns:
- The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.
-
withAvailableIpAddressCount
public Subnet withAvailableIpAddressCount(Integer availableIpAddressCount)
The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.
- Parameters:
availableIpAddressCount- The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAvailabilityZone
public void setAvailabilityZone(String availabilityZone)
The Availability Zone of the subnet.
- Parameters:
availabilityZone- The Availability Zone of the subnet.
-
getAvailabilityZone
public String getAvailabilityZone()
The Availability Zone of the subnet.
- Returns:
- The Availability Zone of the subnet.
-
withAvailabilityZone
public Subnet withAvailabilityZone(String availabilityZone)
The Availability Zone of the subnet.
- Parameters:
availabilityZone- The Availability Zone of the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDefaultForAz
public void setDefaultForAz(Boolean defaultForAz)
Indicates whether this is the default subnet for the Availability Zone.
- Parameters:
defaultForAz- Indicates whether this is the default subnet for the Availability Zone.
-
getDefaultForAz
public Boolean getDefaultForAz()
Indicates whether this is the default subnet for the Availability Zone.
- Returns:
- Indicates whether this is the default subnet for the Availability Zone.
-
withDefaultForAz
public Subnet withDefaultForAz(Boolean defaultForAz)
Indicates whether this is the default subnet for the Availability Zone.
- Parameters:
defaultForAz- Indicates whether this is the default subnet for the Availability Zone.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isDefaultForAz
public Boolean isDefaultForAz()
Indicates whether this is the default subnet for the Availability Zone.
- Returns:
- Indicates whether this is the default subnet for the Availability Zone.
-
setMapPublicIpOnLaunch
public void setMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
Indicates whether instances launched in this subnet receive a public IP address.
- Parameters:
mapPublicIpOnLaunch- Indicates whether instances launched in this subnet receive a public IP address.
-
getMapPublicIpOnLaunch
public Boolean getMapPublicIpOnLaunch()
Indicates whether instances launched in this subnet receive a public IP address.
- Returns:
- Indicates whether instances launched in this subnet receive a public IP address.
-
withMapPublicIpOnLaunch
public Subnet withMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
Indicates whether instances launched in this subnet receive a public IP address.
- Parameters:
mapPublicIpOnLaunch- Indicates whether instances launched in this subnet receive a public IP address.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isMapPublicIpOnLaunch
public Boolean isMapPublicIpOnLaunch()
Indicates whether instances launched in this subnet receive a public IP address.
- Returns:
- Indicates whether instances launched in this subnet receive a public IP address.
-
getTags
public List<Tag> getTags()
Any tags assigned to the subnet.
- Returns:
- Any tags assigned to the subnet.
-
setTags
public void setTags(Collection<Tag> tags)
Any tags assigned to the subnet.
- Parameters:
tags- Any tags assigned to the subnet.
-
withTags
public Subnet withTags(Tag... tags)
Any tags assigned to the subnet.
NOTE: This method appends the values to the existing list (if any). Use
setTags(java.util.Collection)orwithTags(java.util.Collection)if you want to override the existing values.- Parameters:
tags- Any tags assigned to the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withTags
public Subnet withTags(Collection<Tag> tags)
Any tags assigned to the subnet.
- Parameters:
tags- Any tags assigned to the subnet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-