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;
Container for the parameters to the DescribeSubnets operation.

Gives you information about your subnets. You can filter the results to return information only about subnets that match criteria you specify. For example, you could ask to get information about a particular subnet (or all) only if the subnet's state is available. You can specify multiple filters (e.g., the subnet is in a particular VPC, and the subnet's state is available). The result includes information for a particular subnet only if the subnet matches all your filters. If there's no match, no special message is returned; the response is simply empty. The following table shows the available filters.

 
 public class DescribeSubnetsRequest extends AmazonWebServiceRequest {

    
A set of one or more subnet IDs.
 
     private java.util.List<StringsubnetIds;

    
 
     private java.util.List<Filterfilters;

    
A set of one or more subnet IDs.

Returns:
A set of one or more subnet IDs.
 
     public java.util.List<StringgetSubnetIds() {
         if ( == null) {
              = new java.util.ArrayList<String>();
         }
         return ;
     }
    
    
A set of one or more subnet IDs.

Parameters:
subnetIds A set of one or more subnet IDs.
 
     public void setSubnetIds(java.util.Collection<StringsubnetIds) {
         java.util.List<StringsubnetIdsCopy = new java.util.ArrayList<String>();
         if (subnetIds != null) {
             subnetIdsCopy.addAll(subnetIds);
         }
         this. = subnetIdsCopy;
     }
    
    
A set of one or more subnet IDs.

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

Parameters:
subnetIds A set of one or more subnet IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DescribeSubnetsRequest withSubnetIds(String... subnetIds) {
         for (String value : subnetIds) {
             getSubnetIds().add(value);
         }
         return this;
     }
    
    
A set of one or more subnet IDs.

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

Parameters:
subnetIds A set of one or more subnet IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
        java.util.List<StringsubnetIdsCopy = new java.util.ArrayList<String>();
        if (subnetIds != null) {
            subnetIdsCopy.addAll(subnetIds);
        }
        this. = subnetIdsCopy;
        return this;
    }
    
    

Returns:
    public java.util.List<FiltergetFilters() {
        if ( == null) {
             = new java.util.ArrayList<Filter>();
        }
        return ;
    }
    
    

Parameters:
filters
    public void setFilters(java.util.Collection<Filterfilters) {
        java.util.List<FilterfiltersCopy = new java.util.ArrayList<Filter>();
        if (filters != null) {
            filtersCopy.addAll(filters);
        }
        this. = filtersCopy;
    }
    
    

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

Parameters:
filters
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSubnetsRequest withFilters(Filter... filters) {
        for (Filter value : filters) {
            getFilters().add(value);
        }
        return this;
    }
    
    

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

Parameters:
filters
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<FilterfiltersCopy = new java.util.ArrayList<Filter>();
        if (filters != null) {
            filtersCopy.addAll(filters);
        }
        this. = filtersCopy;
        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("SubnetIds: " +  + ", ");
        sb.append("Filters: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X