/* * Copyright 2010-2018 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; /** *
* Describes a subnet. *
*/ public class Subnet implements Serializable { /** * The ID of the subnet. */ private String subnetId; /** * The current state of the subnet. *
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* @param subnetId The ID of the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withSubnetId(String subnetId) {
this.subnetId = subnetId;
return this;
}
/**
* The current state of the subnet.
*
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* @param vpcId The ID of the VPC the subnet is in.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withVpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
/**
* The CIDR block assigned to the subnet.
*
* @return The CIDR block assigned to the subnet.
*/
public String getCidrBlock() {
return cidrBlock;
}
/**
* The CIDR block assigned to the subnet.
*
* @param cidrBlock The CIDR block assigned to the subnet.
*/
public void setCidrBlock(String cidrBlock) {
this.cidrBlock = cidrBlock;
}
/**
* The CIDR block assigned to the subnet.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param cidrBlock The CIDR block assigned to the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withCidrBlock(String cidrBlock) {
this.cidrBlock = cidrBlock;
return this;
}
/**
* The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*
* @return The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*/
public Integer getAvailableIpAddressCount() {
return availableIpAddressCount;
}
/**
* The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*
* @param availableIpAddressCount The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*/
public void setAvailableIpAddressCount(Integer availableIpAddressCount) {
this.availableIpAddressCount = availableIpAddressCount;
}
/**
* The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param availableIpAddressCount The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withAvailableIpAddressCount(Integer availableIpAddressCount) {
this.availableIpAddressCount = availableIpAddressCount;
return this;
}
/**
* The Availability Zone of the subnet.
*
* @return The Availability Zone of the subnet.
*/
public String getAvailabilityZone() {
return availabilityZone;
}
/**
* The Availability Zone of the subnet.
*
* @param availabilityZone The Availability Zone of the subnet.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
* The Availability Zone of the subnet.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param availabilityZone The Availability Zone of the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
return this;
}
/**
* Indicates whether this is the default subnet for the Availability
* Zone.
*
* @return Indicates whether this is the default subnet for the Availability
* Zone.
*/
public Boolean isDefaultForAz() {
return defaultForAz;
}
/**
* Indicates whether this is the default subnet for the Availability
* Zone.
*
* @param defaultForAz Indicates whether this is the default subnet for the Availability
* Zone.
*/
public void setDefaultForAz(Boolean defaultForAz) {
this.defaultForAz = defaultForAz;
}
/**
* Indicates whether this is the default subnet for the Availability
* Zone.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param defaultForAz Indicates whether this is the default subnet for the Availability
* Zone.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withDefaultForAz(Boolean defaultForAz) {
this.defaultForAz = defaultForAz;
return this;
}
/**
* Indicates whether this is the default subnet for the Availability
* Zone.
*
* @return Indicates whether this is the default subnet for the Availability
* Zone.
*/
public Boolean getDefaultForAz() {
return defaultForAz;
}
/**
* Indicates whether instances launched in this subnet receive a public
* IP address.
*
* @return Indicates whether instances launched in this subnet receive a public
* IP address.
*/
public Boolean isMapPublicIpOnLaunch() {
return mapPublicIpOnLaunch;
}
/**
* Indicates whether instances launched in this subnet receive a public
* IP address.
*
* @param mapPublicIpOnLaunch Indicates whether instances launched in this subnet receive a public
* IP address.
*/
public void setMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) {
this.mapPublicIpOnLaunch = mapPublicIpOnLaunch;
}
/**
* Indicates whether instances launched in this subnet receive a public
* IP address.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param mapPublicIpOnLaunch Indicates whether instances launched in this subnet receive a public
* IP address.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) {
this.mapPublicIpOnLaunch = mapPublicIpOnLaunch;
return this;
}
/**
* Indicates whether instances launched in this subnet receive a public
* IP address.
*
* @return Indicates whether instances launched in this subnet receive a public
* IP address.
*/
public Boolean getMapPublicIpOnLaunch() {
return mapPublicIpOnLaunch;
}
/**
* Any tags assigned to the subnet.
*
* @return Any tags assigned to the subnet.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param tags Any tags assigned to the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withTags(Tag... tags) {
if (getTags() == null) setTags(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param tags Any tags assigned to the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Subnet withTags(java.util.Collection
* Allowed Values: pending, available
*/
private String state;
/**
* The ID of the VPC the subnet is in.
*/
private String vpcId;
/**
* The CIDR block assigned to the subnet.
*/
private String cidrBlock;
/**
* The number of unused IP addresses in the subnet. Note that the IP
* addresses for any stopped instances are considered unavailable.
*/
private Integer availableIpAddressCount;
/**
* The Availability Zone of the subnet.
*/
private String availabilityZone;
/**
* Indicates whether this is the default subnet for the Availability
* Zone.
*/
private Boolean defaultForAz;
/**
* Indicates whether instances launched in this subnet receive a public
* IP address.
*/
private Boolean mapPublicIpOnLaunch;
/**
* Any tags assigned to the subnet.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag
* Allowed Values: pending, available
*
* @return The current state of the subnet.
*
* @see SubnetState
*/
public String getState() {
return state;
}
/**
* The current state of the subnet.
*
* Allowed Values: pending, available
*
* @param state The current state of the subnet.
*
* @see SubnetState
*/
public void setState(String state) {
this.state = state;
}
/**
* The current state of the subnet.
*
* Allowed Values: pending, available
*
* @param state The current state of the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see SubnetState
*/
public Subnet withState(String state) {
this.state = state;
return this;
}
/**
* The current state of the subnet.
*
* Allowed Values: pending, available
*
* @param state The current state of the subnet.
*
* @see SubnetState
*/
public void setState(SubnetState state) {
this.state = state.toString();
}
/**
* The current state of the subnet.
*
* Allowed Values: pending, available
*
* @param state The current state of the subnet.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see SubnetState
*/
public Subnet withState(SubnetState state) {
this.state = state.toString();
return this;
}
/**
* The ID of the VPC the subnet is in.
*
* @return The ID of the VPC the subnet is in.
*/
public String getVpcId() {
return vpcId;
}
/**
* The ID of the VPC the subnet is in.
*
* @param vpcId The ID of the VPC the subnet is in.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
* The ID of the VPC the subnet is in.
*