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 the output of one of the following actions:

  • AuthorizeCacheSecurityGroupIngress
  • CreateCacheSecurityGroup
  • RevokeCacheSecurityGroupIngress
 
 public class CacheSecurityGroup implements SerializableCloneable {

    
The AWS account ID of the cache security group owner.
 
     private String ownerId;

    
The name of the cache security group.
 
     private String cacheSecurityGroupName;

    
The description of the cache security group.
 
     private String description;

    
A list of Amazon EC2 security groups that are associated with this cache security group.
 
The AWS account ID of the cache security group owner.

Returns:
The AWS account ID of the cache security group owner.
 
     public String getOwnerId() {
         return ;
     }
    
    
The AWS account ID of the cache security group owner.

Parameters:
ownerId The AWS account ID of the cache security group owner.
 
     public void setOwnerId(String ownerId) {
         this. = ownerId;
     }
    
    
The AWS account ID of the cache security group owner.

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

Parameters:
ownerId The AWS account ID of the cache security group owner.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CacheSecurityGroup withOwnerId(String ownerId) {
         this. = ownerId;
         return this;
     }

    
The name of the cache security group.

Returns:
The name of the cache security group.
 
     public String getCacheSecurityGroupName() {
         return ;
     }
    
    
The name of the cache security group.

Parameters:
cacheSecurityGroupName The name of the cache security group.
    public void setCacheSecurityGroupName(String cacheSecurityGroupName) {
        this. = cacheSecurityGroupName;
    }
    
    
The name of the cache security group.

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

Parameters:
cacheSecurityGroupName The name of the cache security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CacheSecurityGroup withCacheSecurityGroupName(String cacheSecurityGroupName) {
        this. = cacheSecurityGroupName;
        return this;
    }

    
The description of the cache security group.

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

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

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

Parameters:
description The description of the cache security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CacheSecurityGroup withDescription(String description) {
        this. = description;
        return this;
    }

    
A list of Amazon EC2 security groups that are associated with this cache security group.

Returns:
A list of Amazon EC2 security groups that are associated with this cache security group.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of Amazon EC2 security groups that are associated with this cache security group.

Parameters:
eC2SecurityGroups A list of Amazon EC2 security groups that are associated with this cache security group.
    public void setEC2SecurityGroups(java.util.Collection<EC2SecurityGroupeC2SecurityGroups) {
        if (eC2SecurityGroups == null) {
            this. = null;
            return;
        }
        eC2SecurityGroupsCopy.addAll(eC2SecurityGroups);
        this. = eC2SecurityGroupsCopy;
    }
    
    
A list of Amazon EC2 security groups that are associated with this cache security group.

NOTE: This method appends the values to the existing list (if any). Use setEC2SecurityGroups(java.util.Collection) or withEC2SecurityGroups(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:
eC2SecurityGroups A list of Amazon EC2 security groups that are associated with this cache security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CacheSecurityGroup withEC2SecurityGroups(EC2SecurityGroup... eC2SecurityGroups) {
        if (getEC2SecurityGroups() == nullsetEC2SecurityGroups(new java.util.ArrayList<EC2SecurityGroup>(eC2SecurityGroups.length));
        for (EC2SecurityGroup value : eC2SecurityGroups) {
            getEC2SecurityGroups().add(value);
        }
        return this;
    }
    
    
A list of Amazon EC2 security groups that are associated with this cache security group.

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

Parameters:
eC2SecurityGroups A list of Amazon EC2 security groups that are associated with this cache security group.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (eC2SecurityGroups == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<EC2SecurityGroupeC2SecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<EC2SecurityGroup>(eC2SecurityGroups.size());
            eC2SecurityGroupsCopy.addAll(eC2SecurityGroups);
            this. = eC2SecurityGroupsCopy;
        }
        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 (getOwnerId() != nullsb.append("OwnerId: " + getOwnerId() + ",");
        if (getCacheSecurityGroupName() != nullsb.append("CacheSecurityGroupName: " + getCacheSecurityGroupName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getEC2SecurityGroups() != nullsb.append("EC2SecurityGroups: " + getEC2SecurityGroups() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getCacheSecurityGroupName() == null) ? 0 : getCacheSecurityGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getEC2SecurityGroups() == null) ? 0 : getEC2SecurityGroups().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CacheSecurityGroup == falsereturn false;
        CacheSecurityGroup other = (CacheSecurityGroup)obj;
        
        if (other.getOwnerId() == null ^ this.getOwnerId() == nullreturn false;
        if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == falsereturn false
        if (other.getCacheSecurityGroupName() == null ^ this.getCacheSecurityGroupName() == nullreturn false;
        if (other.getCacheSecurityGroupName() != null && other.getCacheSecurityGroupName().equals(this.getCacheSecurityGroupName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getEC2SecurityGroups() == null ^ this.getEC2SecurityGroups() == nullreturn false;
        if (other.getEC2SecurityGroups() != null && other.getEC2SecurityGroups().equals(this.getEC2SecurityGroups()) == falsereturn false
        return true;
    }
    
    @Override
    public CacheSecurityGroup clone() {
        try {
            return (CacheSecurityGroupsuper.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