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;
 

A list of all available options

 
 public class OptionConfiguration implements SerializableCloneable {

    
The configuration of options to include in a group.
 
     private String optionName;

    
The optional port for the option.
 
     private Integer port;

    
A list of DBSecurityGroupMemebrship name strings used for this option.
 
A list of VpcSecurityGroupMemebrship name strings used for this option.
 
The option settings to include in an option group.
 
The configuration of options to include in a group.

Returns:
The configuration of options to include in a group.
 
     public String getOptionName() {
         return ;
     }
    
    
The configuration of options to include in a group.

Parameters:
optionName The configuration of options to include in a group.
 
     public void setOptionName(String optionName) {
         this. = optionName;
     }
    
    
The configuration of options to include in a group.

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

Parameters:
optionName The configuration of options to include in a group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public OptionConfiguration withOptionName(String optionName) {
         this. = optionName;
         return this;
     }

    
The optional port for the option.

Returns:
The optional port for the option.
 
     public Integer getPort() {
         return ;
     }
    
    
The optional port for the option.

Parameters:
port The optional port for the option.
 
     public void setPort(Integer port) {
        this. = port;
    }
    
    
The optional port for the option.

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

Parameters:
port The optional port for the option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withPort(Integer port) {
        this. = port;
        return this;
    }

    
A list of DBSecurityGroupMemebrship name strings used for this option.

Returns:
A list of DBSecurityGroupMemebrship name strings used for this option.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of DBSecurityGroupMemebrship name strings used for this option.

Parameters:
dBSecurityGroupMemberships A list of DBSecurityGroupMemebrship name strings used for this option.
    public void setDBSecurityGroupMemberships(java.util.Collection<StringdBSecurityGroupMemberships) {
        if (dBSecurityGroupMemberships == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringdBSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(dBSecurityGroupMemberships.size());
        dBSecurityGroupMembershipsCopy.addAll(dBSecurityGroupMemberships);
        this. = dBSecurityGroupMembershipsCopy;
    }
    
    
A list of DBSecurityGroupMemebrship name strings used for this option.

NOTE: This method appends the values to the existing list (if any). Use setDBSecurityGroupMemberships(java.util.Collection) or withDBSecurityGroupMemberships(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:
dBSecurityGroupMemberships A list of DBSecurityGroupMemebrship name strings used for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withDBSecurityGroupMemberships(String... dBSecurityGroupMemberships) {
        if (getDBSecurityGroupMemberships() == nullsetDBSecurityGroupMemberships(new java.util.ArrayList<String>(dBSecurityGroupMemberships.length));
        for (String value : dBSecurityGroupMemberships) {
            getDBSecurityGroupMemberships().add(value);
        }
        return this;
    }
    
    
A list of DBSecurityGroupMemebrship name strings used for this option.

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

Parameters:
dBSecurityGroupMemberships A list of DBSecurityGroupMemebrship name strings used for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withDBSecurityGroupMemberships(java.util.Collection<StringdBSecurityGroupMemberships) {
        if (dBSecurityGroupMemberships == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringdBSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(dBSecurityGroupMemberships.size());
            dBSecurityGroupMembershipsCopy.addAll(dBSecurityGroupMemberships);
            this. = dBSecurityGroupMembershipsCopy;
        }
        return this;
    }

    
A list of VpcSecurityGroupMemebrship name strings used for this option.

Returns:
A list of VpcSecurityGroupMemebrship name strings used for this option.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of VpcSecurityGroupMemebrship name strings used for this option.

Parameters:
vpcSecurityGroupMemberships A list of VpcSecurityGroupMemebrship name strings used for this option.
    public void setVpcSecurityGroupMemberships(java.util.Collection<StringvpcSecurityGroupMemberships) {
        if (vpcSecurityGroupMemberships == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringvpcSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(vpcSecurityGroupMemberships.size());
        vpcSecurityGroupMembershipsCopy.addAll(vpcSecurityGroupMemberships);
        this. = vpcSecurityGroupMembershipsCopy;
    }
    
    
A list of VpcSecurityGroupMemebrship name strings used for this option.

NOTE: This method appends the values to the existing list (if any). Use setVpcSecurityGroupMemberships(java.util.Collection) or withVpcSecurityGroupMemberships(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:
vpcSecurityGroupMemberships A list of VpcSecurityGroupMemebrship name strings used for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withVpcSecurityGroupMemberships(String... vpcSecurityGroupMemberships) {
        if (getVpcSecurityGroupMemberships() == nullsetVpcSecurityGroupMemberships(new java.util.ArrayList<String>(vpcSecurityGroupMemberships.length));
        for (String value : vpcSecurityGroupMemberships) {
            getVpcSecurityGroupMemberships().add(value);
        }
        return this;
    }
    
    
A list of VpcSecurityGroupMemebrship name strings used for this option.

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

Parameters:
vpcSecurityGroupMemberships A list of VpcSecurityGroupMemebrship name strings used for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withVpcSecurityGroupMemberships(java.util.Collection<StringvpcSecurityGroupMemberships) {
        if (vpcSecurityGroupMemberships == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringvpcSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(vpcSecurityGroupMemberships.size());
            vpcSecurityGroupMembershipsCopy.addAll(vpcSecurityGroupMemberships);
            this. = vpcSecurityGroupMembershipsCopy;
        }
        return this;
    }

    
The option settings to include in an option group.

Returns:
The option settings to include in an option group.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The option settings to include in an option group.

Parameters:
optionSettings The option settings to include in an option group.
    public void setOptionSettings(java.util.Collection<OptionSettingoptionSettings) {
        if (optionSettings == null) {
            this. = null;
            return;
        }
        optionSettingsCopy.addAll(optionSettings);
        this. = optionSettingsCopy;
    }
    
    
The option settings to include in an option group.

NOTE: This method appends the values to the existing list (if any). Use setOptionSettings(java.util.Collection) or withOptionSettings(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:
optionSettings The option settings to include in an option group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public OptionConfiguration withOptionSettings(OptionSetting... optionSettings) {
        if (getOptionSettings() == nullsetOptionSettings(new java.util.ArrayList<OptionSetting>(optionSettings.length));
        for (OptionSetting value : optionSettings) {
            getOptionSettings().add(value);
        }
        return this;
    }
    
    
The option settings to include in an option group.

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

Parameters:
optionSettings The option settings to include in an option group.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (optionSettings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<OptionSettingoptionSettingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<OptionSetting>(optionSettings.size());
            optionSettingsCopy.addAll(optionSettings);
            this. = optionSettingsCopy;
        }
        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 (getOptionName() != nullsb.append("OptionName: " + getOptionName() + ",");
        if (getPort() != nullsb.append("Port: " + getPort() + ",");
        if (getDBSecurityGroupMemberships() != nullsb.append("DBSecurityGroupMemberships: " + getDBSecurityGroupMemberships() + ",");
        if (getVpcSecurityGroupMemberships() != nullsb.append("VpcSecurityGroupMemberships: " + getVpcSecurityGroupMemberships() + ",");
        if (getOptionSettings() != nullsb.append("OptionSettings: " + getOptionSettings() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getOptionName() == null) ? 0 : getOptionName().hashCode()); 
        hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); 
        hashCode = prime * hashCode + ((getDBSecurityGroupMemberships() == null) ? 0 : getDBSecurityGroupMemberships().hashCode()); 
        hashCode = prime * hashCode + ((getVpcSecurityGroupMemberships() == null) ? 0 : getVpcSecurityGroupMemberships().hashCode()); 
        hashCode = prime * hashCode + ((getOptionSettings() == null) ? 0 : getOptionSettings().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof OptionConfiguration == falsereturn false;
        OptionConfiguration other = (OptionConfiguration)obj;
        
        if (other.getOptionName() == null ^ this.getOptionName() == nullreturn false;
        if (other.getOptionName() != null && other.getOptionName().equals(this.getOptionName()) == falsereturn false
        if (other.getPort() == null ^ this.getPort() == nullreturn false;
        if (other.getPort() != null && other.getPort().equals(this.getPort()) == falsereturn false
        if (other.getDBSecurityGroupMemberships() == null ^ this.getDBSecurityGroupMemberships() == nullreturn false;
        if (other.getDBSecurityGroupMemberships() != null && other.getDBSecurityGroupMemberships().equals(this.getDBSecurityGroupMemberships()) == falsereturn false
        if (other.getVpcSecurityGroupMemberships() == null ^ this.getVpcSecurityGroupMemberships() == nullreturn false;
        if (other.getVpcSecurityGroupMemberships() != null && other.getVpcSecurityGroupMemberships().equals(this.getVpcSecurityGroupMemberships()) == falsereturn false
        if (other.getOptionSettings() == null ^ this.getOptionSettings() == nullreturn false;
        if (other.getOptionSettings() != null && other.getOptionSettings().equals(this.getOptionSettings()) == falsereturn false
        return true;
    }
    
    @Override
    public OptionConfiguration clone() {
        try {
            return (OptionConfigurationsuper.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