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;
 

Option details.

 
 public class Option implements SerializableCloneable {

    
The name of the option.
 
     private String optionName;

    
The description of the option.
 
     private String optionDescription;

    
Indicate if this option is persistent.
 
     private Boolean persistent;

    
Indicate if this option is permanent.
 
     private Boolean permanent;

    
If required, the port configured for this option to use.
 
     private Integer port;

    
The option settings for this option.
 
If the option requires access to a port, then this DB security group allows access to the port.
 
If the option requires access to a port, then this VPC security group allows access to the port.
 
The name of the option.

Returns:
The name of the option.
 
     public String getOptionName() {
         return ;
     }
    
    
The name of the option.

Parameters:
optionName The name of the option.
 
     public void setOptionName(String optionName) {
         this. = optionName;
     }
    
    
The name of the option.

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

Parameters:
optionName The name of the option.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Option withOptionName(String optionName) {
         this. = optionName;
         return this;
     }

    
The description of the option.

Returns:
The description of the option.
    public String getOptionDescription() {
        return ;
    }
    
    
The description of the option.

Parameters:
optionDescription The description of the option.
    public void setOptionDescription(String optionDescription) {
        this. = optionDescription;
    }
    
    
The description of the option.

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

Parameters:
optionDescription The description of the option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withOptionDescription(String optionDescription) {
        this. = optionDescription;
        return this;
    }

    
Indicate if this option is persistent.

Returns:
Indicate if this option is persistent.
    public Boolean isPersistent() {
        return ;
    }
    
    
Indicate if this option is persistent.

Parameters:
persistent Indicate if this option is persistent.
    public void setPersistent(Boolean persistent) {
        this. = persistent;
    }
    
    
Indicate if this option is persistent.

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

Parameters:
persistent Indicate if this option is persistent.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withPersistent(Boolean persistent) {
        this. = persistent;
        return this;
    }

    
Indicate if this option is persistent.

Returns:
Indicate if this option is persistent.
    public Boolean getPersistent() {
        return ;
    }

    
Indicate if this option is permanent.

Returns:
Indicate if this option is permanent.
    public Boolean isPermanent() {
        return ;
    }
    
    
Indicate if this option is permanent.

Parameters:
permanent Indicate if this option is permanent.
    public void setPermanent(Boolean permanent) {
        this. = permanent;
    }
    
    
Indicate if this option is permanent.

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

Parameters:
permanent Indicate if this option is permanent.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withPermanent(Boolean permanent) {
        this. = permanent;
        return this;
    }

    
Indicate if this option is permanent.

Returns:
Indicate if this option is permanent.
    public Boolean getPermanent() {
        return ;
    }

    
If required, the port configured for this option to use.

Returns:
If required, the port configured for this option to use.
    public Integer getPort() {
        return ;
    }
    
    
If required, the port configured for this option to use.

Parameters:
port If required, the port configured for this option to use.
    public void setPort(Integer port) {
        this. = port;
    }
    
    
If required, the port configured for this option to use.

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

Parameters:
port If required, the port configured for this option to use.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withPort(Integer port) {
        this. = port;
        return this;
    }

    
The option settings for this option.

Returns:
The option settings for this option.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The option settings for this option.

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

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 for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option 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 for this option.

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

Parameters:
optionSettings The option settings for this option.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withOptionSettings(java.util.Collection<OptionSettingoptionSettings) {
        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;
    }

    
If the option requires access to a port, then this DB security group allows access to the port.

Returns:
If the option requires access to a port, then this DB security group allows access to the port.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
If the option requires access to a port, then this DB security group allows access to the port.

Parameters:
dBSecurityGroupMemberships If the option requires access to a port, then this DB security group allows access to the port.
    public void setDBSecurityGroupMemberships(java.util.Collection<DBSecurityGroupMembershipdBSecurityGroupMemberships) {
        if (dBSecurityGroupMemberships == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<DBSecurityGroupMembershipdBSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<DBSecurityGroupMembership>(dBSecurityGroupMemberships.size());
        dBSecurityGroupMembershipsCopy.addAll(dBSecurityGroupMemberships);
        this. = dBSecurityGroupMembershipsCopy;
    }
    
    
If the option requires access to a port, then this DB security group allows access to the port.

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 If the option requires access to a port, then this DB security group allows access to the port.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withDBSecurityGroupMemberships(DBSecurityGroupMembership... dBSecurityGroupMemberships) {
        if (getDBSecurityGroupMemberships() == nullsetDBSecurityGroupMemberships(new java.util.ArrayList<DBSecurityGroupMembership>(dBSecurityGroupMemberships.length));
        for (DBSecurityGroupMembership value : dBSecurityGroupMemberships) {
            getDBSecurityGroupMemberships().add(value);
        }
        return this;
    }
    
    
If the option requires access to a port, then this DB security group allows access to the port.

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

Parameters:
dBSecurityGroupMemberships If the option requires access to a port, then this DB security group allows access to the port.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withDBSecurityGroupMemberships(java.util.Collection<DBSecurityGroupMembershipdBSecurityGroupMemberships) {
        if (dBSecurityGroupMemberships == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<DBSecurityGroupMembershipdBSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<DBSecurityGroupMembership>(dBSecurityGroupMemberships.size());
            dBSecurityGroupMembershipsCopy.addAll(dBSecurityGroupMemberships);
            this. = dBSecurityGroupMembershipsCopy;
        }
        return this;
    }

    
If the option requires access to a port, then this VPC security group allows access to the port.

Returns:
If the option requires access to a port, then this VPC security group allows access to the port.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
If the option requires access to a port, then this VPC security group allows access to the port.

Parameters:
vpcSecurityGroupMemberships If the option requires access to a port, then this VPC security group allows access to the port.
    public void setVpcSecurityGroupMemberships(java.util.Collection<VpcSecurityGroupMembershipvpcSecurityGroupMemberships) {
        if (vpcSecurityGroupMemberships == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<VpcSecurityGroupMembershipvpcSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<VpcSecurityGroupMembership>(vpcSecurityGroupMemberships.size());
        vpcSecurityGroupMembershipsCopy.addAll(vpcSecurityGroupMemberships);
        this. = vpcSecurityGroupMembershipsCopy;
    }
    
    
If the option requires access to a port, then this VPC security group allows access to the port.

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 If the option requires access to a port, then this VPC security group allows access to the port.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withVpcSecurityGroupMemberships(VpcSecurityGroupMembership... vpcSecurityGroupMemberships) {
        if (getVpcSecurityGroupMemberships() == nullsetVpcSecurityGroupMemberships(new java.util.ArrayList<VpcSecurityGroupMembership>(vpcSecurityGroupMemberships.length));
        for (VpcSecurityGroupMembership value : vpcSecurityGroupMemberships) {
            getVpcSecurityGroupMemberships().add(value);
        }
        return this;
    }
    
    
If the option requires access to a port, then this VPC security group allows access to the port.

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

Parameters:
vpcSecurityGroupMemberships If the option requires access to a port, then this VPC security group allows access to the port.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Option withVpcSecurityGroupMemberships(java.util.Collection<VpcSecurityGroupMembershipvpcSecurityGroupMemberships) {
        if (vpcSecurityGroupMemberships == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<VpcSecurityGroupMembershipvpcSecurityGroupMembershipsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<VpcSecurityGroupMembership>(vpcSecurityGroupMemberships.size());
            vpcSecurityGroupMembershipsCopy.addAll(vpcSecurityGroupMemberships);
            this. = vpcSecurityGroupMembershipsCopy;
        }
        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 (getOptionDescription() != nullsb.append("OptionDescription: " + getOptionDescription() + ",");
        if (isPersistent() != nullsb.append("Persistent: " + isPersistent() + ",");
        if (isPermanent() != nullsb.append("Permanent: " + isPermanent() + ",");
        if (getPort() != nullsb.append("Port: " + getPort() + ",");
        if (getOptionSettings() != nullsb.append("OptionSettings: " + getOptionSettings() + ",");
        if (getDBSecurityGroupMemberships() != nullsb.append("DBSecurityGroupMemberships: " + getDBSecurityGroupMemberships() + ",");
        if (getVpcSecurityGroupMemberships() != nullsb.append("VpcSecurityGroupMemberships: " + getVpcSecurityGroupMemberships() );
        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 + ((getOptionDescription() == null) ? 0 : getOptionDescription().hashCode()); 
        hashCode = prime * hashCode + ((isPersistent() == null) ? 0 : isPersistent().hashCode()); 
        hashCode = prime * hashCode + ((isPermanent() == null) ? 0 : isPermanent().hashCode()); 
        hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); 
        hashCode = prime * hashCode + ((getOptionSettings() == null) ? 0 : getOptionSettings().hashCode()); 
        hashCode = prime * hashCode + ((getDBSecurityGroupMemberships() == null) ? 0 : getDBSecurityGroupMemberships().hashCode()); 
        hashCode = prime * hashCode + ((getVpcSecurityGroupMemberships() == null) ? 0 : getVpcSecurityGroupMemberships().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Option == falsereturn false;
        Option other = (Option)obj;
        
        if (other.getOptionName() == null ^ this.getOptionName() == nullreturn false;
        if (other.getOptionName() != null && other.getOptionName().equals(this.getOptionName()) == falsereturn false
        if (other.getOptionDescription() == null ^ this.getOptionDescription() == nullreturn false;
        if (other.getOptionDescription() != null && other.getOptionDescription().equals(this.getOptionDescription()) == falsereturn false
        if (other.isPersistent() == null ^ this.isPersistent() == nullreturn false;
        if (other.isPersistent() != null && other.isPersistent().equals(this.isPersistent()) == falsereturn false
        if (other.isPermanent() == null ^ this.isPermanent() == nullreturn false;
        if (other.isPermanent() != null && other.isPermanent().equals(this.isPermanent()) == falsereturn false
        if (other.getPort() == null ^ this.getPort() == nullreturn false;
        if (other.getPort() != null && other.getPort().equals(this.getPort()) == falsereturn false
        if (other.getOptionSettings() == null ^ this.getOptionSettings() == nullreturn false;
        if (other.getOptionSettings() != null && other.getOptionSettings().equals(this.getOptionSettings()) == 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
        return true;
    }
    
    @Override
    public Option clone() {
        try {
            return (Optionsuper.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