Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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;

The Subnet data type.

 
 public class Subnet {

    
Specifies the ID of the subnet.
 
     private String subnetId;

    
Describes the current state of the subnet. The state of the subnet may be either pending or available.
 
     private String state;

    
Contains the ID of the VPC the subnet is in.
 
     private String vpcId;

    
Specifies the CIDR block assigned to the subnet.
 
     private String cidrBlock;

    
Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

 
     private Integer availableIpAddressCount;

    
Specifies the Availability Zone the subnet is in.
 
     private String availabilityZone;

    
A list of tags for the Subnet.
 
     private java.util.List<Tagtags;

    
Specifies the ID of the subnet.

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

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

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

Parameters:
subnetId Specifies the ID of the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Subnet withSubnetId(String subnetId) {
         this. = subnetId;
         return this;
     }
    
    
    
Describes the current state of the subnet. The state of the subnet may be either pending or available.

Returns:
Describes the current state of the subnet. The state of the subnet may be either pending or available.
    public String getState() {
        return ;
    }
    
    
Describes the current state of the subnet. The state of the subnet may be either pending or available.

Parameters:
state Describes the current state of the subnet. The state of the subnet may be either pending or available.
    public void setState(String state) {
        this. = state;
    }
    
    
Describes the current state of the subnet. The state of the subnet may be either pending or available.

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

Parameters:
state Describes the current state of the subnet. The state of the subnet may be either pending or available.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withState(String state) {
        this. = state;
        return this;
    }
    
    
    
Contains the ID of the VPC the subnet is in.

Returns:
Contains the ID of the VPC the subnet is in.
    public String getVpcId() {
        return ;
    }
    
    
Contains the ID of the VPC the subnet is in.

Parameters:
vpcId Contains the ID of the VPC the subnet is in.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
Contains the ID of the VPC the subnet is in.

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

Parameters:
vpcId Contains the ID of the VPC the subnet is in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }
    
    
    
Specifies the CIDR block assigned to the subnet.

Returns:
Specifies the CIDR block assigned to the subnet.
    public String getCidrBlock() {
        return ;
    }
    
    
Specifies the CIDR block assigned to the subnet.

Parameters:
cidrBlock Specifies the CIDR block assigned to the subnet.
    public void setCidrBlock(String cidrBlock) {
        this. = cidrBlock;
    }
    
    
Specifies the CIDR block assigned to the subnet.

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

Parameters:
cidrBlock Specifies the CIDR block assigned to the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withCidrBlock(String cidrBlock) {
        this. = cidrBlock;
        return this;
    }
    
    
    
Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

Returns:
Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

        return ;
    }
    
    
Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

Parameters:
availableIpAddressCount Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

    public void setAvailableIpAddressCount(Integer availableIpAddressCount) {
        this. = availableIpAddressCount;
    }
    
    
Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

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

Parameters:
availableIpAddressCount Specifies the number of unused IP addresses in the subnet. <note>

The IP addresses for any stopped instances are considered unavailable. </note>

Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withAvailableIpAddressCount(Integer availableIpAddressCount) {
        this. = availableIpAddressCount;
        return this;
    }
    
    
    
Specifies the Availability Zone the subnet is in.

Returns:
Specifies the Availability Zone the subnet is in.
    public String getAvailabilityZone() {
        return ;
    }
    
    
Specifies the Availability Zone the subnet is in.

Parameters:
availabilityZone Specifies the Availability Zone the subnet is in.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
Specifies the Availability Zone the subnet is in.

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

Parameters:
availabilityZone Specifies the Availability Zone the subnet is in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }
    
    
    
A list of tags for the Subnet.

Returns:
A list of tags for the Subnet.
    public java.util.List<TaggetTags() {
        if ( == null) {
             = new java.util.ArrayList<Tag>();
        }
        return ;
    }
    
    
A list of tags for the Subnet.

Parameters:
tags A list of tags for the Subnet.
    public void setTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
    }
    
    
A list of tags for the Subnet.

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

Parameters:
tags A list of tags for the Subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withTags(Tag... tags) {
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
A list of tags for the Subnet.

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

Parameters:
tags A list of tags for the Subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
        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("{");
        sb.append("SubnetId: " +  + ", ");
        sb.append("State: " +  + ", ");
        sb.append("VpcId: " +  + ", ");
        sb.append("CidrBlock: " +  + ", ");
        sb.append("AvailableIpAddressCount: " +  + ", ");
        sb.append("AvailabilityZone: " +  + ", ");
        sb.append("Tags: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X