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

Contains the result of a successful invocation of the following actions:

  • DescribeDBSecurityGroups
  • AuthorizeDBSecurityGroupIngress
  • CreateDBSecurityGroup
  • RevokeDBSecurityGroupIngress

This data type is used as a response element in the DescribeDBSecurityGroups action.

 
 public class DBSecurityGroup implements SerializableCloneable {

    
Provides the AWS ID of the owner of a specific DB security group.
 
     private String ownerId;

    
Specifies the name of the DB security group.
 
     private String dBSecurityGroupName;

    
Provides the description of the DB security group.
 
     private String dBSecurityGroupDescription;

    
Provides the VpcId of the DB security group.
 
     private String vpcId;

    
Contains a list of EC2SecurityGroup elements.
 
Contains a list of IPRange elements.
 
Provides the AWS ID of the owner of a specific DB security group.

Returns:
Provides the AWS ID of the owner of a specific DB security group.
 
     public String getOwnerId() {
         return ;
     }
    
    
Provides the AWS ID of the owner of a specific DB security group.

Parameters:
ownerId Provides the AWS ID of the owner of a specific DB security group.
 
     public void setOwnerId(String ownerId) {
         this. = ownerId;
     }
    
    
Provides the AWS ID of the owner of a specific DB security group.

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

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

    
Specifies the name of the DB security group.

Returns:
Specifies the name of the DB security group.
    public String getDBSecurityGroupName() {
        return ;
    }
    
    
Specifies the name of the DB security group.

Parameters:
dBSecurityGroupName Specifies the name of the DB security group.
    public void setDBSecurityGroupName(String dBSecurityGroupName) {
        this. = dBSecurityGroupName;
    }
    
    
Specifies the name of the DB security group.

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

Parameters:
dBSecurityGroupName Specifies the name of the DB security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withDBSecurityGroupName(String dBSecurityGroupName) {
        this. = dBSecurityGroupName;
        return this;
    }

    
Provides the description of the DB security group.

Returns:
Provides the description of the DB security group.
        return ;
    }
    
    
Provides the description of the DB security group.

Parameters:
dBSecurityGroupDescription Provides the description of the DB security group.
    public void setDBSecurityGroupDescription(String dBSecurityGroupDescription) {
        this. = dBSecurityGroupDescription;
    }
    
    
Provides the description of the DB security group.

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

Parameters:
dBSecurityGroupDescription Provides the description of the DB security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withDBSecurityGroupDescription(String dBSecurityGroupDescription) {
        this. = dBSecurityGroupDescription;
        return this;
    }

    
Provides the VpcId of the DB security group.

Returns:
Provides the VpcId of the DB security group.
    public String getVpcId() {
        return ;
    }
    
    
Provides the VpcId of the DB security group.

Parameters:
vpcId Provides the VpcId of the DB security group.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
Provides the VpcId of the DB security group.

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

Parameters:
vpcId Provides the VpcId of the DB security group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
Contains a list of EC2SecurityGroup elements.

Returns:
Contains a list of EC2SecurityGroup elements.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Contains a list of EC2SecurityGroup elements.

Parameters:
eC2SecurityGroups Contains a list of EC2SecurityGroup elements.
    public void setEC2SecurityGroups(java.util.Collection<EC2SecurityGroupeC2SecurityGroups) {
        if (eC2SecurityGroups == null) {
            this. = null;
            return;
        }
        eC2SecurityGroupsCopy.addAll(eC2SecurityGroups);
        this. = eC2SecurityGroupsCopy;
    }
    
    
Contains a list of EC2SecurityGroup elements.

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 Contains a list of EC2SecurityGroup elements.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withEC2SecurityGroups(EC2SecurityGroup... eC2SecurityGroups) {
        if (getEC2SecurityGroups() == nullsetEC2SecurityGroups(new java.util.ArrayList<EC2SecurityGroup>(eC2SecurityGroups.length));
        for (EC2SecurityGroup value : eC2SecurityGroups) {
            getEC2SecurityGroups().add(value);
        }
        return this;
    }
    
    
Contains a list of EC2SecurityGroup elements.

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

Parameters:
eC2SecurityGroups Contains a list of EC2SecurityGroup elements.
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;
    }

    
Contains a list of IPRange elements.

Returns:
Contains a list of IPRange elements.
    public java.util.List<IPRangegetIPRanges() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<IPRange>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Contains a list of IPRange elements.

Parameters:
iPRanges Contains a list of IPRange elements.
    public void setIPRanges(java.util.Collection<IPRangeiPRanges) {
        if (iPRanges == null) {
            this. = null;
            return;
        }
        iPRangesCopy.addAll(iPRanges);
        this. = iPRangesCopy;
    }
    
    
Contains a list of IPRange elements.

NOTE: This method appends the values to the existing list (if any). Use setIPRanges(java.util.Collection) or withIPRanges(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:
iPRanges Contains a list of IPRange elements.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withIPRanges(IPRange... iPRanges) {
        if (getIPRanges() == nullsetIPRanges(new java.util.ArrayList<IPRange>(iPRanges.length));
        for (IPRange value : iPRanges) {
            getIPRanges().add(value);
        }
        return this;
    }
    
    
Contains a list of IPRange elements.

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

Parameters:
iPRanges Contains a list of IPRange elements.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DBSecurityGroup withIPRanges(java.util.Collection<IPRangeiPRanges) {
        if (iPRanges == null) {
            this. = null;
        } else {
            iPRangesCopy.addAll(iPRanges);
            this. = iPRangesCopy;
        }
        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 (getDBSecurityGroupName() != nullsb.append("DBSecurityGroupName: " + getDBSecurityGroupName() + ",");
        if (getDBSecurityGroupDescription() != nullsb.append("DBSecurityGroupDescription: " + getDBSecurityGroupDescription() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getEC2SecurityGroups() != nullsb.append("EC2SecurityGroups: " + getEC2SecurityGroups() + ",");
        if (getIPRanges() != nullsb.append("IPRanges: " + getIPRanges() );
        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 + ((getDBSecurityGroupName() == null) ? 0 : getDBSecurityGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getDBSecurityGroupDescription() == null) ? 0 : getDBSecurityGroupDescription().hashCode()); 
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getEC2SecurityGroups() == null) ? 0 : getEC2SecurityGroups().hashCode()); 
        hashCode = prime * hashCode + ((getIPRanges() == null) ? 0 : getIPRanges().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DBSecurityGroup == falsereturn false;
        DBSecurityGroup other = (DBSecurityGroup)obj;
        
        if (other.getOwnerId() == null ^ this.getOwnerId() == nullreturn false;
        if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == falsereturn false
        if (other.getDBSecurityGroupName() == null ^ this.getDBSecurityGroupName() == nullreturn false;
        if (other.getDBSecurityGroupName() != null && other.getDBSecurityGroupName().equals(this.getDBSecurityGroupName()) == falsereturn false
        if (other.getDBSecurityGroupDescription() == null ^ this.getDBSecurityGroupDescription() == nullreturn false;
        if (other.getDBSecurityGroupDescription() != null && other.getDBSecurityGroupDescription().equals(this.getDBSecurityGroupDescription()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getEC2SecurityGroups() == null ^ this.getEC2SecurityGroups() == nullreturn false;
        if (other.getEC2SecurityGroups() != null && other.getEC2SecurityGroups().equals(this.getEC2SecurityGroups()) == falsereturn false
        if (other.getIPRanges() == null ^ this.getIPRanges() == nullreturn false;
        if (other.getIPRanges() != null && other.getIPRanges().equals(this.getIPRanges()) == falsereturn false
        return true;
    }
    
    @Override
    public DBSecurityGroup clone() {
        try {
            return (DBSecurityGroupsuper.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