com.amazonaws.services.cloudformation.model.ListStacksRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk Show documentation
/*
* Copyright 2010-2014 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.cloudformation.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
* Container for the parameters to the {@link com.amazonaws.services.cloudformation.AmazonCloudFormation#listStacks(ListStacksRequest) ListStacks operation}.
*
* Returns the summary information for stacks whose status matches the
* specified StackStatusFilter. Summary information for stacks that have
* been deleted is kept for 90 days after the stack is deleted. If no
* StackStatusFilter is specified, summary information for all stacks is
* returned (including existing stacks and stacks that have been
* deleted).
*
*
* @see com.amazonaws.services.cloudformation.AmazonCloudFormation#listStacks(ListStacksRequest)
*/
public class ListStacksRequest extends AmazonWebServiceRequest implements Serializable {
/**
* String that identifies the start of the next list of stacks, if there
* is one. Default: There is no default value.
*
* Constraints:
* Length: 1 - 1024
*/
private String nextToken;
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag stackStatusFilters;
/**
* String that identifies the start of the next list of stacks, if there
* is one. Default: There is no default value.
*
* Constraints:
* Length: 1 - 1024
*
* @return String that identifies the start of the next list of stacks, if there
* is one.
Default: There is no default value.
*/
public String getNextToken() {
return nextToken;
}
/**
* String that identifies the start of the next list of stacks, if there
* is one.
Default: There is no default value.
*
* Constraints:
* Length: 1 - 1024
*
* @param nextToken String that identifies the start of the next list of stacks, if there
* is one.
Default: There is no default value.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* String that identifies the start of the next list of stacks, if there
* is one.
Default: There is no default value.
*
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Length: 1 - 1024
*
* @param nextToken String that identifies the start of the next list of stacks, if there
* is one.
Default: There is no default value.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ListStacksRequest withNextToken(String nextToken) {
this.nextToken = nextToken;
return this;
}
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* @return Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*/
public java.util.List getStackStatusFilters() {
if (stackStatusFilters == null) {
stackStatusFilters = new com.amazonaws.internal.ListWithAutoConstructFlag();
stackStatusFilters.setAutoConstruct(true);
}
return stackStatusFilters;
}
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* @param stackStatusFilters Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*/
public void setStackStatusFilters(java.util.Collection stackStatusFilters) {
if (stackStatusFilters == null) {
this.stackStatusFilters = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag stackStatusFiltersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(stackStatusFilters.size());
stackStatusFiltersCopy.addAll(stackStatusFilters);
this.stackStatusFilters = stackStatusFiltersCopy;
}
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param stackStatusFilters Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ListStacksRequest withStackStatusFilters(String... stackStatusFilters) {
if (getStackStatusFilters() == null) setStackStatusFilters(new java.util.ArrayList(stackStatusFilters.length));
for (String value : stackStatusFilters) {
getStackStatusFilters().add(value);
}
return this;
}
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param stackStatusFilters Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ListStacksRequest withStackStatusFilters(java.util.Collection stackStatusFilters) {
if (stackStatusFilters == null) {
this.stackStatusFilters = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag stackStatusFiltersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(stackStatusFilters.size());
stackStatusFiltersCopy.addAll(stackStatusFilters);
this.stackStatusFilters = stackStatusFiltersCopy;
}
return this;
}
/**
* Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param stackStatusFilters Stack status to use as a filter. Specify one or more stack status
* codes to list only stacks with the specified status codes. For a
* complete list of stack status codes, see the StackStatus
* parameter of the Stack data type.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ListStacksRequest withStackStatusFilters(StackStatus... stackStatusFilters) {
java.util.ArrayList stackStatusFiltersCopy = new java.util.ArrayList(stackStatusFilters.length);
for (StackStatus member : stackStatusFilters) {
stackStatusFiltersCopy.add(member.toString());
}
if (getStackStatusFilters() == null) {
setStackStatusFilters(stackStatusFiltersCopy);
} else {
getStackStatusFilters().addAll(stackStatusFiltersCopy);
}
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getNextToken() != null) sb.append("NextToken: " + getNextToken() + ",");
if (getStackStatusFilters() != null) sb.append("StackStatusFilters: " + getStackStatusFilters() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getStackStatusFilters() == null) ? 0 : getStackStatusFilters().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof ListStacksRequest == false) return false;
ListStacksRequest other = (ListStacksRequest)obj;
if (other.getNextToken() == null ^ this.getNextToken() == null) return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false;
if (other.getStackStatusFilters() == null ^ this.getStackStatusFilters() == null) return false;
if (other.getStackStatusFilters() != null && other.getStackStatusFilters().equals(this.getStackStatusFilters()) == false) return false;
return true;
}
}