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;
 

Contains all of the attributes of a specific replication group.

 
 public class ReplicationGroup implements SerializableCloneable {

    
The identifier for the replication group.
 
     private String replicationGroupId;

    
The description of the replication group.
 
     private String description;

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

    
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.
 
The names of all the cache clusters that are part of this replication group.
 
A single element list with information about the nodes in the replication group.
 
The cache cluster ID that is used as the daily snapshot source for the replication group.
 
     private String snapshottingClusterId;

    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

 
     private String automaticFailover;

    
The identifier for the replication group.

Returns:
The identifier for the replication group.
 
     public String getReplicationGroupId() {
         return ;
     }
    
    
The identifier for the replication group.

Parameters:
replicationGroupId The identifier for the replication group.
 
     public void setReplicationGroupId(String replicationGroupId) {
         this. = replicationGroupId;
     }
    
    
The identifier for the replication group.

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

Parameters:
replicationGroupId The identifier for the replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withReplicationGroupId(String replicationGroupId) {
        this. = replicationGroupId;
        return this;
    }

    
The description of the replication group.

Returns:
The description of the replication group.
    public String getDescription() {
        return ;
    }
    
    
The description of the replication group.

Parameters:
description The description of the replication group.
    public void setDescription(String description) {
        this. = description;
    }
    
    
The description of the replication group.

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

Parameters:
description The description of the replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withDescription(String description) {
        this. = description;
        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 ReplicationGroup withStatus(String status) {
        this. = status;
        return this;
    }

    
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.

Returns:
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.
        return ;
    }
    
    
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.

Parameters:
pendingModifiedValues A group of settings to be applied to the replication group, either immediately or during the next maintenance window.
    public void setPendingModifiedValues(ReplicationGroupPendingModifiedValues pendingModifiedValues) {
        this. = pendingModifiedValues;
    }
    
    
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.

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

Parameters:
pendingModifiedValues A group of settings to be applied to the replication group, either immediately or during the next maintenance window.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = pendingModifiedValues;
        return this;
    }

    
The names of all the cache clusters that are part of this replication group.

Returns:
The names of all the cache clusters that are part of this replication group.
    public java.util.List<StringgetMemberClusters() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The names of all the cache clusters that are part of this replication group.

Parameters:
memberClusters The names of all the cache clusters that are part of this replication group.
    public void setMemberClusters(java.util.Collection<StringmemberClusters) {
        if (memberClusters == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringmemberClustersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(memberClusters.size());
        memberClustersCopy.addAll(memberClusters);
        this. = memberClustersCopy;
    }
    
    
The names of all the cache clusters that are part of this replication group.

NOTE: This method appends the values to the existing list (if any). Use setMemberClusters(java.util.Collection) or withMemberClusters(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:
memberClusters The names of all the cache clusters that are part of this replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withMemberClusters(String... memberClusters) {
        if (getMemberClusters() == nullsetMemberClusters(new java.util.ArrayList<String>(memberClusters.length));
        for (String value : memberClusters) {
            getMemberClusters().add(value);
        }
        return this;
    }
    
    
The names of all the cache clusters that are part of this replication group.

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

Parameters:
memberClusters The names of all the cache clusters that are part of this replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withMemberClusters(java.util.Collection<StringmemberClusters) {
        if (memberClusters == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringmemberClustersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(memberClusters.size());
            memberClustersCopy.addAll(memberClusters);
            this. = memberClustersCopy;
        }
        return this;
    }

    
A single element list with information about the nodes in the replication group.

Returns:
A single element list with information about the nodes in the replication group.
    public java.util.List<NodeGroupgetNodeGroups() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<NodeGroup>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A single element list with information about the nodes in the replication group.

Parameters:
nodeGroups A single element list with information about the nodes in the replication group.
    public void setNodeGroups(java.util.Collection<NodeGroupnodeGroups) {
        if (nodeGroups == null) {
            this. = null;
            return;
        }
        nodeGroupsCopy.addAll(nodeGroups);
        this. = nodeGroupsCopy;
    }
    
    
A single element list with information about the nodes in the replication group.

NOTE: This method appends the values to the existing list (if any). Use setNodeGroups(java.util.Collection) or withNodeGroups(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:
nodeGroups A single element list with information about the nodes in the replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withNodeGroups(NodeGroup... nodeGroups) {
        if (getNodeGroups() == nullsetNodeGroups(new java.util.ArrayList<NodeGroup>(nodeGroups.length));
        for (NodeGroup value : nodeGroups) {
            getNodeGroups().add(value);
        }
        return this;
    }
    
    
A single element list with information about the nodes in the replication group.

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

Parameters:
nodeGroups A single element list with information about the nodes in the replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (nodeGroups == null) {
            this. = null;
        } else {
            nodeGroupsCopy.addAll(nodeGroups);
            this. = nodeGroupsCopy;
        }
        return this;
    }

    
The cache cluster ID that is used as the daily snapshot source for the replication group.

Returns:
The cache cluster ID that is used as the daily snapshot source for the replication group.
    public String getSnapshottingClusterId() {
        return ;
    }
    
    
The cache cluster ID that is used as the daily snapshot source for the replication group.

Parameters:
snapshottingClusterId The cache cluster ID that is used as the daily snapshot source for the replication group.
    public void setSnapshottingClusterId(String snapshottingClusterId) {
        this. = snapshottingClusterId;
    }
    
    
The cache cluster ID that is used as the daily snapshot source for the replication group.

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

Parameters:
snapshottingClusterId The cache cluster ID that is used as the daily snapshot source for the replication group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplicationGroup withSnapshottingClusterId(String snapshottingClusterId) {
        this. = snapshottingClusterId;
        return this;
    }

    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

Returns:
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>
See also:
AutomaticFailoverStatus
    public String getAutomaticFailover() {
        return ;
    }
    
    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

Parameters:
automaticFailover Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>
See also:
AutomaticFailoverStatus
    public void setAutomaticFailover(String automaticFailover) {
        this. = automaticFailover;
    }
    
    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

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

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

Parameters:
automaticFailover Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AutomaticFailoverStatus
    public ReplicationGroup withAutomaticFailover(String automaticFailover) {
        this. = automaticFailover;
        return this;
    }

    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

Parameters:
automaticFailover Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>
See also:
AutomaticFailoverStatus
    public void setAutomaticFailover(AutomaticFailoverStatus automaticFailover) {
        this. = automaticFailover.toString();
    }
    
    
Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>

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

Constraints:
Allowed Values: enabled, disabled, enabling, disabling

Parameters:
automaticFailover Indicates the status of Multi-AZ for this replication group. <note>

ElastiCache Multi-AZ replication groups are not supported on:

  • Redis versions earlier than 2.8.6.
  • T1 and T2 cache node types.
</note>
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AutomaticFailoverStatus
    public ReplicationGroup withAutomaticFailover(AutomaticFailoverStatus automaticFailover) {
        this. = automaticFailover.toString();
        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 (getReplicationGroupId() != nullsb.append("ReplicationGroupId: " + getReplicationGroupId() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getPendingModifiedValues() != nullsb.append("PendingModifiedValues: " + getPendingModifiedValues() + ",");
        if (getMemberClusters() != nullsb.append("MemberClusters: " + getMemberClusters() + ",");
        if (getNodeGroups() != nullsb.append("NodeGroups: " + getNodeGroups() + ",");
        if (getSnapshottingClusterId() != nullsb.append("SnapshottingClusterId: " + getSnapshottingClusterId() + ",");
        if (getAutomaticFailover() != nullsb.append("AutomaticFailover: " + getAutomaticFailover() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getReplicationGroupId() == null) ? 0 : getReplicationGroupId().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getPendingModifiedValues() == null) ? 0 : getPendingModifiedValues().hashCode()); 
        hashCode = prime * hashCode + ((getMemberClusters() == null) ? 0 : getMemberClusters().hashCode()); 
        hashCode = prime * hashCode + ((getNodeGroups() == null) ? 0 : getNodeGroups().hashCode()); 
        hashCode = prime * hashCode + ((getSnapshottingClusterId() == null) ? 0 : getSnapshottingClusterId().hashCode()); 
        hashCode = prime * hashCode + ((getAutomaticFailover() == null) ? 0 : getAutomaticFailover().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ReplicationGroup == falsereturn false;
        ReplicationGroup other = (ReplicationGroup)obj;
        
        if (other.getReplicationGroupId() == null ^ this.getReplicationGroupId() == nullreturn false;
        if (other.getReplicationGroupId() != null && other.getReplicationGroupId().equals(this.getReplicationGroupId()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getPendingModifiedValues() == null ^ this.getPendingModifiedValues() == nullreturn false;
        if (other.getPendingModifiedValues() != null && other.getPendingModifiedValues().equals(this.getPendingModifiedValues()) == falsereturn false
        if (other.getMemberClusters() == null ^ this.getMemberClusters() == nullreturn false;
        if (other.getMemberClusters() != null && other.getMemberClusters().equals(this.getMemberClusters()) == falsereturn false
        if (other.getNodeGroups() == null ^ this.getNodeGroups() == nullreturn false;
        if (other.getNodeGroups() != null && other.getNodeGroups().equals(this.getNodeGroups()) == falsereturn false
        if (other.getSnapshottingClusterId() == null ^ this.getSnapshottingClusterId() == nullreturn false;
        if (other.getSnapshottingClusterId() != null && other.getSnapshottingClusterId().equals(this.getSnapshottingClusterId()) == falsereturn false
        if (other.getAutomaticFailover() == null ^ this.getAutomaticFailover() == nullreturn false;
        if (other.getAutomaticFailover() != null && other.getAutomaticFailover().equals(this.getAutomaticFailover()) == falsereturn false
        return true;
    }
    
    @Override
    public ReplicationGroup clone() {
        try {
            return (ReplicationGroupsuper.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