/*
* Copyright 2014-2019 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;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OptionGroup implements Serializable, Cloneable {
/**
*
* Specifies the name of the option group.
*
*/
private String optionGroupName;
/**
*
* Provides a description of the option group.
*
*/
private String optionGroupDescription;
/**
*
* Indicates the name of the engine that this option group can be applied to.
*
*/
private String engineName;
/**
*
* Indicates the major engine version associated with this option group.
*
*/
private String majorEngineVersion;
/**
*
* Indicates what options are available in the option group.
*
*/
private com.amazonaws.internal.SdkInternalList options;
/**
*
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value true
* indicates the option group can be applied to both VPC and non-VPC instances.
*
*/
private Boolean allowsVpcAndNonVpcInstanceMemberships;
/**
*
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this option group
* can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only
* be applied to instances that are in the VPC indicated by this field.
*
*/
private String vpcId;
/**
*
* The Amazon Resource Name (ARN) for the option group.
*
*/
private String optionGroupArn;
/**
*
* Specifies the name of the option group.
*
*
* @param optionGroupName
* Specifies the name of the option group.
*/
public void setOptionGroupName(String optionGroupName) {
this.optionGroupName = optionGroupName;
}
/**
*
* Specifies the name of the option group.
*
*
* @return Specifies the name of the option group.
*/
public String getOptionGroupName() {
return this.optionGroupName;
}
/**
*
* Specifies the name of the option group.
*
*
* @param optionGroupName
* Specifies the name of the option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withOptionGroupName(String optionGroupName) {
setOptionGroupName(optionGroupName);
return this;
}
/**
*
* Provides a description of the option group.
*
*
* @param optionGroupDescription
* Provides a description of the option group.
*/
public void setOptionGroupDescription(String optionGroupDescription) {
this.optionGroupDescription = optionGroupDescription;
}
/**
*
* Provides a description of the option group.
*
*
* @return Provides a description of the option group.
*/
public String getOptionGroupDescription() {
return this.optionGroupDescription;
}
/**
*
* Provides a description of the option group.
*
*
* @param optionGroupDescription
* Provides a description of the option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withOptionGroupDescription(String optionGroupDescription) {
setOptionGroupDescription(optionGroupDescription);
return this;
}
/**
*
* Indicates the name of the engine that this option group can be applied to.
*
*
* @param engineName
* Indicates the name of the engine that this option group can be applied to.
*/
public void setEngineName(String engineName) {
this.engineName = engineName;
}
/**
*
* Indicates the name of the engine that this option group can be applied to.
*
*
* @return Indicates the name of the engine that this option group can be applied to.
*/
public String getEngineName() {
return this.engineName;
}
/**
*
* Indicates the name of the engine that this option group can be applied to.
*
*
* @param engineName
* Indicates the name of the engine that this option group can be applied to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withEngineName(String engineName) {
setEngineName(engineName);
return this;
}
/**
*
* Indicates the major engine version associated with this option group.
*
*
* @param majorEngineVersion
* Indicates the major engine version associated with this option group.
*/
public void setMajorEngineVersion(String majorEngineVersion) {
this.majorEngineVersion = majorEngineVersion;
}
/**
*
* Indicates the major engine version associated with this option group.
*
*
* @return Indicates the major engine version associated with this option group.
*/
public String getMajorEngineVersion() {
return this.majorEngineVersion;
}
/**
*
* Indicates the major engine version associated with this option group.
*
*
* @param majorEngineVersion
* Indicates the major engine version associated with this option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withMajorEngineVersion(String majorEngineVersion) {
setMajorEngineVersion(majorEngineVersion);
return this;
}
/**
*
* Indicates what options are available in the option group.
*
*
* @return Indicates what options are available in the option group.
*/
public java.util.List getOptions() {
if (options == null) {
options = new com.amazonaws.internal.SdkInternalList ();
}
return options;
}
/**
*
* Indicates what options are available in the option group.
*
*
* @param options
* Indicates what options are available in the option group.
*/
public void setOptions(java.util.Collection options) {
if (options == null) {
this.options = null;
return;
}
this.options = new com.amazonaws.internal.SdkInternalList (options);
}
/**
*
* Indicates what options are available in the option group.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOptions(java.util.Collection)} or {@link #withOptions(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param options
* Indicates what options are available in the option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withOptions(Option... options) {
if (this.options == null) {
setOptions(new com.amazonaws.internal.SdkInternalList (options.length));
}
for (Option ele : options) {
this.options.add(ele);
}
return this;
}
/**
*
* Indicates what options are available in the option group.
*
*
* @param options
* Indicates what options are available in the option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withOptions(java.util.Collection options) {
setOptions(options);
return this;
}
/**
*
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value true
* indicates the option group can be applied to both VPC and non-VPC instances.
*
*
* @param allowsVpcAndNonVpcInstanceMemberships
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value
* true
indicates the option group can be applied to both VPC and non-VPC instances.
*/
public void setAllowsVpcAndNonVpcInstanceMemberships(Boolean allowsVpcAndNonVpcInstanceMemberships) {
this.allowsVpcAndNonVpcInstanceMemberships = allowsVpcAndNonVpcInstanceMemberships;
}
/**
*
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value true
* indicates the option group can be applied to both VPC and non-VPC instances.
*
*
* @return Indicates whether this option group can be applied to both VPC and non-VPC instances. The value
* true
indicates the option group can be applied to both VPC and non-VPC instances.
*/
public Boolean getAllowsVpcAndNonVpcInstanceMemberships() {
return this.allowsVpcAndNonVpcInstanceMemberships;
}
/**
*
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value true
* indicates the option group can be applied to both VPC and non-VPC instances.
*
*
* @param allowsVpcAndNonVpcInstanceMemberships
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value
* true
indicates the option group can be applied to both VPC and non-VPC instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withAllowsVpcAndNonVpcInstanceMemberships(Boolean allowsVpcAndNonVpcInstanceMemberships) {
setAllowsVpcAndNonVpcInstanceMemberships(allowsVpcAndNonVpcInstanceMemberships);
return this;
}
/**
*
* Indicates whether this option group can be applied to both VPC and non-VPC instances. The value true
* indicates the option group can be applied to both VPC and non-VPC instances.
*
*
* @return Indicates whether this option group can be applied to both VPC and non-VPC instances. The value
* true
indicates the option group can be applied to both VPC and non-VPC instances.
*/
public Boolean isAllowsVpcAndNonVpcInstanceMemberships() {
return this.allowsVpcAndNonVpcInstanceMemberships;
}
/**
*
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this option group
* can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only
* be applied to instances that are in the VPC indicated by this field.
*
*
* @param vpcId
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this
* option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this
* option group can only be applied to instances that are in the VPC indicated by this field.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this option group
* can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only
* be applied to instances that are in the VPC indicated by this field.
*
*
* @return If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this
* option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this
* option group can only be applied to instances that are in the VPC indicated by this field.
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this option group
* can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only
* be applied to instances that are in the VPC indicated by this field.
*
*
* @param vpcId
* If AllowsVpcAndNonVpcInstanceMemberships is false
, this field is blank. If
* AllowsVpcAndNonVpcInstanceMemberships is true
and this field is blank, then this
* option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this
* option group can only be applied to instances that are in the VPC indicated by this field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) for the option group.
*
*
* @param optionGroupArn
* The Amazon Resource Name (ARN) for the option group.
*/
public void setOptionGroupArn(String optionGroupArn) {
this.optionGroupArn = optionGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) for the option group.
*
*
* @return The Amazon Resource Name (ARN) for the option group.
*/
public String getOptionGroupArn() {
return this.optionGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) for the option group.
*
*
* @param optionGroupArn
* The Amazon Resource Name (ARN) for the option group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OptionGroup withOptionGroupArn(String optionGroupArn) {
setOptionGroupArn(optionGroupArn);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getOptionGroupName() != null)
sb.append("OptionGroupName: ").append(getOptionGroupName()).append(",");
if (getOptionGroupDescription() != null)
sb.append("OptionGroupDescription: ").append(getOptionGroupDescription()).append(",");
if (getEngineName() != null)
sb.append("EngineName: ").append(getEngineName()).append(",");
if (getMajorEngineVersion() != null)
sb.append("MajorEngineVersion: ").append(getMajorEngineVersion()).append(",");
if (getOptions() != null)
sb.append("Options: ").append(getOptions()).append(",");
if (getAllowsVpcAndNonVpcInstanceMemberships() != null)
sb.append("AllowsVpcAndNonVpcInstanceMemberships: ").append(getAllowsVpcAndNonVpcInstanceMemberships()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getOptionGroupArn() != null)
sb.append("OptionGroupArn: ").append(getOptionGroupArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OptionGroup == false)
return false;
OptionGroup other = (OptionGroup) obj;
if (other.getOptionGroupName() == null ^ this.getOptionGroupName() == null)
return false;
if (other.getOptionGroupName() != null && other.getOptionGroupName().equals(this.getOptionGroupName()) == false)
return false;
if (other.getOptionGroupDescription() == null ^ this.getOptionGroupDescription() == null)
return false;
if (other.getOptionGroupDescription() != null && other.getOptionGroupDescription().equals(this.getOptionGroupDescription()) == false)
return false;
if (other.getEngineName() == null ^ this.getEngineName() == null)
return false;
if (other.getEngineName() != null && other.getEngineName().equals(this.getEngineName()) == false)
return false;
if (other.getMajorEngineVersion() == null ^ this.getMajorEngineVersion() == null)
return false;
if (other.getMajorEngineVersion() != null && other.getMajorEngineVersion().equals(this.getMajorEngineVersion()) == false)
return false;
if (other.getOptions() == null ^ this.getOptions() == null)
return false;
if (other.getOptions() != null && other.getOptions().equals(this.getOptions()) == false)
return false;
if (other.getAllowsVpcAndNonVpcInstanceMemberships() == null ^ this.getAllowsVpcAndNonVpcInstanceMemberships() == null)
return false;
if (other.getAllowsVpcAndNonVpcInstanceMemberships() != null
&& other.getAllowsVpcAndNonVpcInstanceMemberships().equals(this.getAllowsVpcAndNonVpcInstanceMemberships()) == false)
return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
return false;
if (other.getOptionGroupArn() == null ^ this.getOptionGroupArn() == null)
return false;
if (other.getOptionGroupArn() != null && other.getOptionGroupArn().equals(this.getOptionGroupArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOptionGroupName() == null) ? 0 : getOptionGroupName().hashCode());
hashCode = prime * hashCode + ((getOptionGroupDescription() == null) ? 0 : getOptionGroupDescription().hashCode());
hashCode = prime * hashCode + ((getEngineName() == null) ? 0 : getEngineName().hashCode());
hashCode = prime * hashCode + ((getMajorEngineVersion() == null) ? 0 : getMajorEngineVersion().hashCode());
hashCode = prime * hashCode + ((getOptions() == null) ? 0 : getOptions().hashCode());
hashCode = prime * hashCode + ((getAllowsVpcAndNonVpcInstanceMemberships() == null) ? 0 : getAllowsVpcAndNonVpcInstanceMemberships().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getOptionGroupArn() == null) ? 0 : getOptionGroupArn().hashCode());
return hashCode;
}
@Override
public OptionGroup clone() {
try {
return (OptionGroup) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}