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.elasticache.model;
 

Represents a single node within a node group.

 
 public class NodeGroupMember implements SerializableCloneable {

    
The ID of the cache cluster to which the node belongs.
 
     private String cacheClusterId;

    
The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).
 
     private String cacheNodeId;

    
Represents the information required for client programs to connect to a cache node.
 
     private Endpoint readEndpoint;

    
The name of the Availability Zone in which the node is located.
 
     private String preferredAvailabilityZone;

    
The role that is currently assigned to the node - primary or replica.
 
     private String currentRole;

    
The ID of the cache cluster to which the node belongs.

Returns:
The ID of the cache cluster to which the node belongs.
 
     public String getCacheClusterId() {
         return ;
     }
    
    
The ID of the cache cluster to which the node belongs.

Parameters:
cacheClusterId The ID of the cache cluster to which the node belongs.
 
     public void setCacheClusterId(String cacheClusterId) {
         this. = cacheClusterId;
     }
    
    
The ID of the cache cluster to which the node belongs.

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

Parameters:
cacheClusterId The ID of the cache cluster to which the node belongs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public NodeGroupMember withCacheClusterId(String cacheClusterId) {
         this. = cacheClusterId;
         return this;
     }

    
The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).

Returns:
The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).
 
     public String getCacheNodeId() {
         return ;
     }
    
    
The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).

Parameters:
cacheNodeId The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).
    public void setCacheNodeId(String cacheNodeId) {
        this. = cacheNodeId;
    }
    
    
The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).

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

Parameters:
cacheNodeId The ID of the node within its cache cluster. A node ID is a numeric identifier (0001, 0002, etc.).
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroupMember withCacheNodeId(String cacheNodeId) {
        this. = cacheNodeId;
        return this;
    }

    
Represents the information required for client programs to connect to a cache node.

Returns:
Represents the information required for client programs to connect to a cache node.
    public Endpoint getReadEndpoint() {
        return ;
    }
    
    
Represents the information required for client programs to connect to a cache node.

Parameters:
readEndpoint Represents the information required for client programs to connect to a cache node.
    public void setReadEndpoint(Endpoint readEndpoint) {
        this. = readEndpoint;
    }
    
    
Represents the information required for client programs to connect to a cache node.

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

Parameters:
readEndpoint Represents the information required for client programs to connect to a cache node.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroupMember withReadEndpoint(Endpoint readEndpoint) {
        this. = readEndpoint;
        return this;
    }

    
The name of the Availability Zone in which the node is located.

Returns:
The name of the Availability Zone in which the node is located.
        return ;
    }
    
    
The name of the Availability Zone in which the node is located.

Parameters:
preferredAvailabilityZone The name of the Availability Zone in which the node is located.
    public void setPreferredAvailabilityZone(String preferredAvailabilityZone) {
        this. = preferredAvailabilityZone;
    }
    
    
The name of the Availability Zone in which the node is located.

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

Parameters:
preferredAvailabilityZone The name of the Availability Zone in which the node is located.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroupMember withPreferredAvailabilityZone(String preferredAvailabilityZone) {
        this. = preferredAvailabilityZone;
        return this;
    }

    
The role that is currently assigned to the node - primary or replica.

Returns:
The role that is currently assigned to the node - primary or replica.
    public String getCurrentRole() {
        return ;
    }
    
    
The role that is currently assigned to the node - primary or replica.

Parameters:
currentRole The role that is currently assigned to the node - primary or replica.
    public void setCurrentRole(String currentRole) {
        this. = currentRole;
    }
    
    
The role that is currently assigned to the node - primary or replica.

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

Parameters:
currentRole The role that is currently assigned to the node - primary or replica.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroupMember withCurrentRole(String currentRole) {
        this. = currentRole;
        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 (getCacheClusterId() != nullsb.append("CacheClusterId: " + getCacheClusterId() + ",");
        if (getCacheNodeId() != nullsb.append("CacheNodeId: " + getCacheNodeId() + ",");
        if (getReadEndpoint() != nullsb.append("ReadEndpoint: " + getReadEndpoint() + ",");
        if (getPreferredAvailabilityZone() != nullsb.append("PreferredAvailabilityZone: " + getPreferredAvailabilityZone() + ",");
        if (getCurrentRole() != nullsb.append("CurrentRole: " + getCurrentRole() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCacheClusterId() == null) ? 0 : getCacheClusterId().hashCode()); 
        hashCode = prime * hashCode + ((getCacheNodeId() == null) ? 0 : getCacheNodeId().hashCode()); 
        hashCode = prime * hashCode + ((getReadEndpoint() == null) ? 0 : getReadEndpoint().hashCode()); 
        hashCode = prime * hashCode + ((getPreferredAvailabilityZone() == null) ? 0 : getPreferredAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getCurrentRole() == null) ? 0 : getCurrentRole().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof NodeGroupMember == falsereturn false;
        NodeGroupMember other = (NodeGroupMember)obj;
        
        if (other.getCacheClusterId() == null ^ this.getCacheClusterId() == nullreturn false;
        if (other.getCacheClusterId() != null && other.getCacheClusterId().equals(this.getCacheClusterId()) == falsereturn false
        if (other.getCacheNodeId() == null ^ this.getCacheNodeId() == nullreturn false;
        if (other.getCacheNodeId() != null && other.getCacheNodeId().equals(this.getCacheNodeId()) == falsereturn false
        if (other.getReadEndpoint() == null ^ this.getReadEndpoint() == nullreturn false;
        if (other.getReadEndpoint() != null && other.getReadEndpoint().equals(this.getReadEndpoint()) == falsereturn false
        if (other.getPreferredAvailabilityZone() == null ^ this.getPreferredAvailabilityZone() == nullreturn false;
        if (other.getPreferredAvailabilityZone() != null && other.getPreferredAvailabilityZone().equals(this.getPreferredAvailabilityZone()) == falsereturn false
        if (other.getCurrentRole() == null ^ this.getCurrentRole() == nullreturn false;
        if (other.getCurrentRole() != null && other.getCurrentRole().equals(this.getCurrentRole()) == falsereturn false
        return true;
    }
    
    @Override
    public NodeGroupMember clone() {
        try {
            return (NodeGroupMembersuper.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