Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.redshift.model;
 

The identifier of a node in a cluster.

 
 public class ClusterNode implements SerializableCloneable {

    
Whether the node is a leader node or a compute node.
 
     private String nodeRole;

    
The private IP address of a node within a cluster.
 
     private String privateIPAddress;

    
The public IP address of a node within a cluster.
 
     private String publicIPAddress;

    
Whether the node is a leader node or a compute node.

Returns:
Whether the node is a leader node or a compute node.
 
     public String getNodeRole() {
         return ;
     }
    
    
Whether the node is a leader node or a compute node.

Parameters:
nodeRole Whether the node is a leader node or a compute node.
 
     public void setNodeRole(String nodeRole) {
         this. = nodeRole;
     }
    
    
Whether the node is a leader node or a compute node.

Returns a reference to this object so that method calls can be chained together.

Parameters:
nodeRole Whether the node is a leader node or a compute node.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ClusterNode withNodeRole(String nodeRole) {
         this. = nodeRole;
         return this;
     }

    
The private IP address of a node within a cluster.

Returns:
The private IP address of a node within a cluster.
 
     public String getPrivateIPAddress() {
         return ;
     }
    
    
The private IP address of a node within a cluster.

Parameters:
privateIPAddress The private IP address of a node within a cluster.
 
     public void setPrivateIPAddress(String privateIPAddress) {
         this. = privateIPAddress;
     }
    
    
The private IP address of a node within a cluster.

Returns a reference to this object so that method calls can be chained together.

Parameters:
privateIPAddress The private IP address of a node within a cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterNode withPrivateIPAddress(String privateIPAddress) {
        this. = privateIPAddress;
        return this;
    }

    
The public IP address of a node within a cluster.

Returns:
The public IP address of a node within a cluster.
    public String getPublicIPAddress() {
        return ;
    }
    
    
The public IP address of a node within a cluster.

Parameters:
publicIPAddress The public IP address of a node within a cluster.
    public void setPublicIPAddress(String publicIPAddress) {
        this. = publicIPAddress;
    }
    
    
The public IP address of a node within a cluster.

Returns a reference to this object so that method calls can be chained together.

Parameters:
publicIPAddress The public IP address of a node within a cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterNode withPublicIPAddress(String publicIPAddress) {
        this. = publicIPAddress;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getNodeRole() != nullsb.append("NodeRole: " + getNodeRole() + ",");
        if (getPrivateIPAddress() != nullsb.append("PrivateIPAddress: " + getPrivateIPAddress() + ",");
        if (getPublicIPAddress() != nullsb.append("PublicIPAddress: " + getPublicIPAddress() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getNodeRole() == null) ? 0 : getNodeRole().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIPAddress() == null) ? 0 : getPrivateIPAddress().hashCode()); 
        hashCode = prime * hashCode + ((getPublicIPAddress() == null) ? 0 : getPublicIPAddress().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ClusterNode == falsereturn false;
        ClusterNode other = (ClusterNode)obj;
        
        if (other.getNodeRole() == null ^ this.getNodeRole() == nullreturn false;
        if (other.getNodeRole() != null && other.getNodeRole().equals(this.getNodeRole()) == falsereturn false
        if (other.getPrivateIPAddress() == null ^ this.getPrivateIPAddress() == nullreturn false;
        if (other.getPrivateIPAddress() != null && other.getPrivateIPAddress().equals(this.getPrivateIPAddress()) == falsereturn false
        if (other.getPublicIPAddress() == null ^ this.getPublicIPAddress() == nullreturn false;
        if (other.getPublicIPAddress() != null && other.getPublicIPAddress().equals(this.getPublicIPAddress()) == falsereturn false
        return true;
    }
    
    @Override
    public ClusterNode clone() {
        try {
            return (ClusterNodesuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X