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 TerminateInstances operation.

The TerminateInstances operation shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call will succeed.

Terminated instances will remain visible after termination (approximately one hour).

 
 public class TerminateInstancesRequest extends AmazonWebServiceRequest {

    
The list of instances to terminate.
 
     private java.util.List<StringinstanceIds;

    
Default constructor for a new TerminateInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public TerminateInstancesRequest() {}
    
    
Constructs a new TerminateInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
instanceIds The list of instances to terminate.
 
     public TerminateInstancesRequest(java.util.List<StringinstanceIds) {
         this. = instanceIds;
     }
    
    
The list of instances to terminate.

Returns:
The list of instances to terminate.
 
     public java.util.List<StringgetInstanceIds() {
         if ( == null) {
              = new java.util.ArrayList<String>();
         }
         return ;
     }
    
    
The list of instances to terminate.

Parameters:
instanceIds The list of instances to terminate.
 
     public void setInstanceIds(java.util.Collection<StringinstanceIds) {
         java.util.List<StringinstanceIdsCopy = new java.util.ArrayList<String>();
         if (instanceIds != null) {
             instanceIdsCopy.addAll(instanceIds);
         }
         this. = instanceIdsCopy;
     }
    
    
The list of instances to terminate.

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

Parameters:
instanceIds The list of instances to terminate.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public TerminateInstancesRequest withInstanceIds(String... instanceIds) {
         for (String value : instanceIds) {
             getInstanceIds().add(value);
         }
         return this;
     }
    
    
The list of instances to terminate.

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

Parameters:
instanceIds The list of instances to terminate.
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<StringinstanceIdsCopy = new java.util.ArrayList<String>();
        if (instanceIds != null) {
            instanceIdsCopy.addAll(instanceIds);
        }
        this. = instanceIdsCopy;
        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("InstanceIds: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X