/* * Copyright 2018-2023 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; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* In a response to a DiscoverInstances request, * HttpInstanceSummary contains information about one instance that matches the values that you specified * in the request. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HttpInstanceSummary implements Serializable, Cloneable, StructuredPojo { /** *

* The ID of an instance that matches the values that you specified in the request. *

*/ private String instanceId; /** *

* *

*

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

*/ private String namespaceName; /** *

* The name of the service that you specified when you registered the instance. *

*/ private String serviceName; /** *

* If you configured health checking in the service, the current health status of the service instance. *

*/ private String healthStatus; /** *

* If you included any attributes when you registered the instance, the values of those attributes. *

*/ private java.util.Map attributes; /** *

* The ID of an instance that matches the values that you specified in the request. *

* * @param instanceId * The ID of an instance that matches the values that you specified in the request. */ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** *

* The ID of an instance that matches the values that you specified in the request. *

* * @return The ID of an instance that matches the values that you specified in the request. */ public String getInstanceId() { return this.instanceId; } /** *

* The ID of an instance that matches the values that you specified in the request. *

* * @param instanceId * The ID of an instance that matches the values that you specified in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary withInstanceId(String instanceId) { setInstanceId(instanceId); return this; } /** *

* *

*

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @param namespaceName *

The HttpName name of the namespace. It's found in the * HttpProperties member of the Properties member of the namespace. */ public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } /** *

* *

*

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @return

The HttpName name of the namespace. It's found in the * HttpProperties member of the Properties member of the namespace. */ public String getNamespaceName() { return this.namespaceName; } /** *

* *

*

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @param namespaceName *

The HttpName name of the namespace. It's found in the * HttpProperties member of the Properties member of the namespace. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary withNamespaceName(String namespaceName) { setNamespaceName(namespaceName); return this; } /** *

* The name of the service that you specified when you registered the instance. *

* * @param serviceName * The name of the service that you specified when you registered the instance. */ public void setServiceName(String serviceName) { this.serviceName = serviceName; } /** *

* The name of the service that you specified when you registered the instance. *

* * @return The name of the service that you specified when you registered the instance. */ public String getServiceName() { return this.serviceName; } /** *

* The name of the service that you specified when you registered the instance. *

* * @param serviceName * The name of the service that you specified when you registered the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary withServiceName(String serviceName) { setServiceName(serviceName); return this; } /** *

* If you configured health checking in the service, the current health status of the service instance. *

* * @param healthStatus * If you configured health checking in the service, the current health status of the service instance. * @see HealthStatus */ public void setHealthStatus(String healthStatus) { this.healthStatus = healthStatus; } /** *

* If you configured health checking in the service, the current health status of the service instance. *

* * @return If you configured health checking in the service, the current health status of the service instance. * @see HealthStatus */ public String getHealthStatus() { return this.healthStatus; } /** *

* If you configured health checking in the service, the current health status of the service instance. *

* * @param healthStatus * If you configured health checking in the service, the current health status of the service instance. * @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatus */ public HttpInstanceSummary withHealthStatus(String healthStatus) { setHealthStatus(healthStatus); return this; } /** *

* If you configured health checking in the service, the current health status of the service instance. *

* * @param healthStatus * If you configured health checking in the service, the current health status of the service instance. * @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatus */ public HttpInstanceSummary withHealthStatus(HealthStatus healthStatus) { this.healthStatus = healthStatus.toString(); return this; } /** *

* If you included any attributes when you registered the instance, the values of those attributes. *

* * @return If you included any attributes when you registered the instance, the values of those attributes. */ public java.util.Map getAttributes() { return attributes; } /** *

* If you included any attributes when you registered the instance, the values of those attributes. *

* * @param attributes * If you included any attributes when you registered the instance, the values of those attributes. */ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* If you included any attributes when you registered the instance, the values of those attributes. *

* * @param attributes * If you included any attributes when you registered the instance, the values of those attributes. * @return Returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary withAttributes(java.util.Map attributes) { setAttributes(attributes); return this; } /** * Add a single Attributes entry * * @see HttpInstanceSummary#withAttributes * @returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary addAttributesEntry(String key, String value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into Attributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public HttpInstanceSummary clearAttributesEntries() { this.attributes = null; 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 (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getNamespaceName() != null) sb.append("NamespaceName: ").append(getNamespaceName()).append(","); if (getServiceName() != null) sb.append("ServiceName: ").append(getServiceName()).append(","); if (getHealthStatus() != null) sb.append("HealthStatus: ").append(getHealthStatus()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof HttpInstanceSummary == false) return false; HttpInstanceSummary other = (HttpInstanceSummary) obj; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getNamespaceName() == null ^ this.getNamespaceName() == null) return false; if (other.getNamespaceName() != null && other.getNamespaceName().equals(this.getNamespaceName()) == false) return false; if (other.getServiceName() == null ^ this.getServiceName() == null) return false; if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == false) return false; if (other.getHealthStatus() == null ^ this.getHealthStatus() == null) return false; if (other.getHealthStatus() != null && other.getHealthStatus().equals(this.getHealthStatus()) == false) return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getNamespaceName() == null) ? 0 : getNamespaceName().hashCode()); hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); return hashCode; } @Override public HttpInstanceSummary clone() { try { return (HttpInstanceSummary) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.servicediscovery.model.transform.HttpInstanceSummaryMarshaller.getInstance().marshall(this, protocolMarshaller); } }