com.amazonaws.services.memorydb.model.Node Maven / Gradle / Ivy
Show all versions of aws-java-sdk-memorydb 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.memorydb.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Represents an individual node within a cluster. Each node runs its own instance of the cluster's protocol-compliant
* caching software.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Node implements Serializable, Cloneable, StructuredPojo {
/**
*
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster name,
* shard name and node name uniquely identifies every node used in a customer's Amazon account.
*
*/
private String name;
/**
*
* The status of the service update on the node
*
*/
private String status;
/**
*
* The Availability Zone in which the node resides
*
*/
private String availabilityZone;
/**
*
* The date and time when the node was created.
*
*/
private java.util.Date createTime;
/**
*
* The hostname for connecting to this node.
*
*/
private Endpoint endpoint;
/**
*
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster name,
* shard name and node name uniquely identifies every node used in a customer's Amazon account.
*
*
* @param name
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster
* name, shard name and node name uniquely identifies every node used in a customer's Amazon account.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster name,
* shard name and node name uniquely identifies every node used in a customer's Amazon account.
*
*
* @return The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster
* name, shard name and node name uniquely identifies every node used in a customer's Amazon account.
*/
public String getName() {
return this.name;
}
/**
*
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster name,
* shard name and node name uniquely identifies every node used in a customer's Amazon account.
*
*
* @param name
* The node identifier. A node name is a numeric identifier (0001, 0002, etc.). The combination of cluster
* name, shard name and node name uniquely identifies every node used in a customer's Amazon account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Node withName(String name) {
setName(name);
return this;
}
/**
*
* The status of the service update on the node
*
*
* @param status
* The status of the service update on the node
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the service update on the node
*
*
* @return The status of the service update on the node
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the service update on the node
*
*
* @param status
* The status of the service update on the node
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Node withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The Availability Zone in which the node resides
*
*
* @param availabilityZone
* The Availability Zone in which the node resides
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* The Availability Zone in which the node resides
*
*
* @return The Availability Zone in which the node resides
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* The Availability Zone in which the node resides
*
*
* @param availabilityZone
* The Availability Zone in which the node resides
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Node withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
*
* The date and time when the node was created.
*
*
* @param createTime
* The date and time when the node was created.
*/
public void setCreateTime(java.util.Date createTime) {
this.createTime = createTime;
}
/**
*
* The date and time when the node was created.
*
*
* @return The date and time when the node was created.
*/
public java.util.Date getCreateTime() {
return this.createTime;
}
/**
*
* The date and time when the node was created.
*
*
* @param createTime
* The date and time when the node was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Node withCreateTime(java.util.Date createTime) {
setCreateTime(createTime);
return this;
}
/**
*
* The hostname for connecting to this node.
*
*
* @param endpoint
* The hostname for connecting to this node.
*/
public void setEndpoint(Endpoint endpoint) {
this.endpoint = endpoint;
}
/**
*
* The hostname for connecting to this node.
*
*
* @return The hostname for connecting to this node.
*/
public Endpoint getEndpoint() {
return this.endpoint;
}
/**
*
* The hostname for connecting to this node.
*
*
* @param endpoint
* The hostname for connecting to this node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Node withEndpoint(Endpoint endpoint) {
setEndpoint(endpoint);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getCreateTime() != null)
sb.append("CreateTime: ").append(getCreateTime()).append(",");
if (getEndpoint() != null)
sb.append("Endpoint: ").append(getEndpoint());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Node == false)
return false;
Node other = (Node) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
if (other.getCreateTime() == null ^ this.getCreateTime() == null)
return false;
if (other.getCreateTime() != null && other.getCreateTime().equals(this.getCreateTime()) == false)
return false;
if (other.getEndpoint() == null ^ this.getEndpoint() == null)
return false;
if (other.getEndpoint() != null && other.getEndpoint().equals(this.getEndpoint()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode());
return hashCode;
}
@Override
public Node clone() {
try {
return (Node) 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.memorydb.model.transform.NodeMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}