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 collection of cache nodes in a replication group.

 
 public class NodeGroup implements SerializableCloneable {

    
The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.
 
     private String nodeGroupId;

    
The current state of this replication group - creating, available, etc.
 
     private String status;

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

    
A list containing information about individual nodes within the node group.
 
The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.

Returns:
The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.
 
     public String getNodeGroupId() {
         return ;
     }
    
    
The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.

Parameters:
nodeGroupId The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.
 
     public void setNodeGroupId(String nodeGroupId) {
         this. = nodeGroupId;
     }
    
    
The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.

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

Parameters:
nodeGroupId The identifier for the node group. A replication group contains only one node group; therefore, the node group ID is 0001.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public NodeGroup withNodeGroupId(String nodeGroupId) {
         this. = nodeGroupId;
         return this;
     }

    
The current state of this replication group - creating, available, etc.

Returns:
The current state of this replication group - creating, available, etc.
 
     public String getStatus() {
         return ;
     }
    
    
The current state of this replication group - creating, available, etc.

Parameters:
status The current state of this replication group - creating, available, etc.
    public void setStatus(String status) {
        this. = status;
    }
    
    
The current state of this replication group - creating, available, etc.

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

Parameters:
status The current state of this replication group - creating, available, etc.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroup withStatus(String status) {
        this. = status;
        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 getPrimaryEndpoint() {
        return ;
    }
    
    
Represents the information required for client programs to connect to a cache node.

Parameters:
primaryEndpoint Represents the information required for client programs to connect to a cache node.
    public void setPrimaryEndpoint(Endpoint primaryEndpoint) {
        this. = primaryEndpoint;
    }
    
    
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:
primaryEndpoint 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 NodeGroup withPrimaryEndpoint(Endpoint primaryEndpoint) {
        this. = primaryEndpoint;
        return this;
    }

    
A list containing information about individual nodes within the node group.

Returns:
A list containing information about individual nodes within the node group.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list containing information about individual nodes within the node group.

Parameters:
nodeGroupMembers A list containing information about individual nodes within the node group.
    public void setNodeGroupMembers(java.util.Collection<NodeGroupMembernodeGroupMembers) {
        if (nodeGroupMembers == null) {
            this. = null;
            return;
        }
        nodeGroupMembersCopy.addAll(nodeGroupMembers);
        this. = nodeGroupMembersCopy;
    }
    
    
A list containing information about individual nodes within the node group.

NOTE: This method appends the values to the existing list (if any). Use setNodeGroupMembers(java.util.Collection) or withNodeGroupMembers(java.util.Collection) if you want to override the existing values.

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

Parameters:
nodeGroupMembers A list containing information about individual nodes within the node group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroup withNodeGroupMembers(NodeGroupMember... nodeGroupMembers) {
        if (getNodeGroupMembers() == nullsetNodeGroupMembers(new java.util.ArrayList<NodeGroupMember>(nodeGroupMembers.length));
        for (NodeGroupMember value : nodeGroupMembers) {
            getNodeGroupMembers().add(value);
        }
        return this;
    }
    
    
A list containing information about individual nodes within the node group.

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

Parameters:
nodeGroupMembers A list containing information about individual nodes within the node group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeGroup withNodeGroupMembers(java.util.Collection<NodeGroupMembernodeGroupMembers) {
        if (nodeGroupMembers == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<NodeGroupMembernodeGroupMembersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<NodeGroupMember>(nodeGroupMembers.size());
            nodeGroupMembersCopy.addAll(nodeGroupMembers);
            this. = nodeGroupMembersCopy;
        }
        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 (getNodeGroupId() != nullsb.append("NodeGroupId: " + getNodeGroupId() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getPrimaryEndpoint() != nullsb.append("PrimaryEndpoint: " + getPrimaryEndpoint() + ",");
        if (getNodeGroupMembers() != nullsb.append("NodeGroupMembers: " + getNodeGroupMembers() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getNodeGroupId() == null) ? 0 : getNodeGroupId().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getPrimaryEndpoint() == null) ? 0 : getPrimaryEndpoint().hashCode()); 
        hashCode = prime * hashCode + ((getNodeGroupMembers() == null) ? 0 : getNodeGroupMembers().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof NodeGroup == falsereturn false;
        NodeGroup other = (NodeGroup)obj;
        
        if (other.getNodeGroupId() == null ^ this.getNodeGroupId() == nullreturn false;
        if (other.getNodeGroupId() != null && other.getNodeGroupId().equals(this.getNodeGroupId()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getPrimaryEndpoint() == null ^ this.getPrimaryEndpoint() == nullreturn false;
        if (other.getPrimaryEndpoint() != null && other.getPrimaryEndpoint().equals(this.getPrimaryEndpoint()) == falsereturn false
        if (other.getNodeGroupMembers() == null ^ this.getNodeGroupMembers() == nullreturn false;
        if (other.getNodeGroupMembers() != null && other.getNodeGroupMembers().equals(this.getNodeGroupMembers()) == falsereturn false
        return true;
    }
    
    @Override
    public NodeGroup clone() {
        try {
            return (NodeGroupsuper.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