com.amazonaws.services.servicediscovery.model.GetInstancesHealthStatusResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servicediscovery Show documentation
/*
* Copyright 2019-2024 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.servicediscovery.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetInstancesHealthStatusResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*
*/
private java.util.Map status;
/**
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
*/
private String nextToken;
/**
*
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*
*
* @return A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*/
public java.util.Map getStatus() {
return status;
}
/**
*
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*
*
* @param status
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*/
public void setStatus(java.util.Map status) {
this.status = status;
}
/**
*
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
*
*
* @param status
* A complex type that contains the IDs and the health status of the instances that you specified in the
* GetInstancesHealthStatus
request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusResult withStatus(java.util.Map status) {
setStatus(status);
return this;
}
/**
* Add a single Status entry
*
* @see GetInstancesHealthStatusResult#withStatus
* @returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusResult addStatusEntry(String key, String value) {
if (null == this.status) {
this.status = new java.util.HashMap();
}
if (this.status.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.status.put(key, value);
return this;
}
/**
* Removes all the entries added into Status.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusResult clearStatusEntries() {
this.status = null;
return this;
}
/**
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
*
* @param nextToken
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
*
* @return If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
*
* @param nextToken
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusResult 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 (getStatus() != null)
sb.append("Status: ").append(getStatus()).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 GetInstancesHealthStatusResult == false)
return false;
GetInstancesHealthStatusResult other = (GetInstancesHealthStatusResult) obj;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == 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 + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public GetInstancesHealthStatusResult clone() {
try {
return (GetInstancesHealthStatusResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}