com.amazonaws.services.ecs.model.DescribeCapacityProvidersResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ecs Show documentation
/*
* Copyright 2016-2021 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.ecs.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeCapacityProvidersResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The list of capacity providers.
*
*/
private com.amazonaws.internal.SdkInternalList capacityProviders;
/**
*
* Any failures associated with the call.
*
*/
private com.amazonaws.internal.SdkInternalList failures;
/**
*
* The nextToken
value to include in a future DescribeCapacityProviders
request. When the
* results of a DescribeCapacityProviders
request exceed maxResults
, this value can be
* used to retrieve the next page of results. This value is null
when there are no more results to
* return.
*
*/
private String nextToken;
/**
*
* The list of capacity providers.
*
*
* @return The list of capacity providers.
*/
public java.util.List getCapacityProviders() {
if (capacityProviders == null) {
capacityProviders = new com.amazonaws.internal.SdkInternalList();
}
return capacityProviders;
}
/**
*
* The list of capacity providers.
*
*
* @param capacityProviders
* The list of capacity providers.
*/
public void setCapacityProviders(java.util.Collection capacityProviders) {
if (capacityProviders == null) {
this.capacityProviders = null;
return;
}
this.capacityProviders = new com.amazonaws.internal.SdkInternalList(capacityProviders);
}
/**
*
* The list of capacity providers.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCapacityProviders(java.util.Collection)} or {@link #withCapacityProviders(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param capacityProviders
* The list of capacity providers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeCapacityProvidersResult withCapacityProviders(CapacityProvider... capacityProviders) {
if (this.capacityProviders == null) {
setCapacityProviders(new com.amazonaws.internal.SdkInternalList(capacityProviders.length));
}
for (CapacityProvider ele : capacityProviders) {
this.capacityProviders.add(ele);
}
return this;
}
/**
*
* The list of capacity providers.
*
*
* @param capacityProviders
* The list of capacity providers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeCapacityProvidersResult withCapacityProviders(java.util.Collection capacityProviders) {
setCapacityProviders(capacityProviders);
return this;
}
/**
*
* Any failures associated with the call.
*
*
* @return Any failures associated with the call.
*/
public java.util.List getFailures() {
if (failures == null) {
failures = new com.amazonaws.internal.SdkInternalList();
}
return failures;
}
/**
*
* Any failures associated with the call.
*
*
* @param failures
* Any failures associated with the call.
*/
public void setFailures(java.util.Collection failures) {
if (failures == null) {
this.failures = null;
return;
}
this.failures = new com.amazonaws.internal.SdkInternalList(failures);
}
/**
*
* Any failures associated with the call.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFailures(java.util.Collection)} or {@link #withFailures(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param failures
* Any failures associated with the call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeCapacityProvidersResult withFailures(Failure... failures) {
if (this.failures == null) {
setFailures(new com.amazonaws.internal.SdkInternalList(failures.length));
}
for (Failure ele : failures) {
this.failures.add(ele);
}
return this;
}
/**
*
* Any failures associated with the call.
*
*
* @param failures
* Any failures associated with the call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeCapacityProvidersResult withFailures(java.util.Collection failures) {
setFailures(failures);
return this;
}
/**
*
* The nextToken
value to include in a future DescribeCapacityProviders
request. When the
* results of a DescribeCapacityProviders
request exceed maxResults
, this value can be
* used to retrieve the next page of results. This value is null
when there are no more results to
* return.
*
*
* @param nextToken
* The nextToken
value to include in a future DescribeCapacityProviders
request.
* When the results of a DescribeCapacityProviders
request exceed maxResults
, this
* value can be used to retrieve the next page of results. This value is null
when there are no
* more results to return.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The nextToken
value to include in a future DescribeCapacityProviders
request. When the
* results of a DescribeCapacityProviders
request exceed maxResults
, this value can be
* used to retrieve the next page of results. This value is null
when there are no more results to
* return.
*
*
* @return The nextToken
value to include in a future DescribeCapacityProviders
request.
* When the results of a DescribeCapacityProviders
request exceed maxResults
, this
* value can be used to retrieve the next page of results. This value is null
when there are no
* more results to return.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The nextToken
value to include in a future DescribeCapacityProviders
request. When the
* results of a DescribeCapacityProviders
request exceed maxResults
, this value can be
* used to retrieve the next page of results. This value is null
when there are no more results to
* return.
*
*
* @param nextToken
* The nextToken
value to include in a future DescribeCapacityProviders
request.
* When the results of a DescribeCapacityProviders
request exceed maxResults
, this
* value can be used to retrieve the next page of results. This value is null
when there are no
* more results to return.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeCapacityProvidersResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCapacityProviders() != null)
sb.append("CapacityProviders: ").append(getCapacityProviders()).append(",");
if (getFailures() != null)
sb.append("Failures: ").append(getFailures()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribeCapacityProvidersResult == false)
return false;
DescribeCapacityProvidersResult other = (DescribeCapacityProvidersResult) obj;
if (other.getCapacityProviders() == null ^ this.getCapacityProviders() == null)
return false;
if (other.getCapacityProviders() != null && other.getCapacityProviders().equals(this.getCapacityProviders()) == false)
return false;
if (other.getFailures() == null ^ this.getFailures() == null)
return false;
if (other.getFailures() != null && other.getFailures().equals(this.getFailures()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCapacityProviders() == null) ? 0 : getCapacityProviders().hashCode());
hashCode = prime * hashCode + ((getFailures() == null) ? 0 : getFailures().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public DescribeCapacityProvidersResult clone() {
try {
return (DescribeCapacityProvidersResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}