software.amazon.awssdk.services.rds.model.OptionSetting Maven / Gradle / Ivy
Show all versions of rds Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.rds.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Option settings are the actual settings being applied or configured for that option. It is used when you modify an
* option group or describe option groups. For example, the NATIVE_NETWORK_ENCRYPTION option has a setting called
* SQLNET.ENCRYPTION_SERVER that can have several different values.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OptionSetting implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(OptionSetting::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField VALUE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Value")
.getter(getter(OptionSetting::value)).setter(setter(Builder::value))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Value").build()).build();
private static final SdkField DEFAULT_VALUE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultValue").getter(getter(OptionSetting::defaultValue)).setter(setter(Builder::defaultValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultValue").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(OptionSetting::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField APPLY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplyType").getter(getter(OptionSetting::applyType)).setter(setter(Builder::applyType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplyType").build()).build();
private static final SdkField DATA_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DataType").getter(getter(OptionSetting::dataType)).setter(setter(Builder::dataType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataType").build()).build();
private static final SdkField ALLOWED_VALUES_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AllowedValues").getter(getter(OptionSetting::allowedValues)).setter(setter(Builder::allowedValues))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowedValues").build()).build();
private static final SdkField IS_MODIFIABLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IsModifiable").getter(getter(OptionSetting::isModifiable)).setter(setter(Builder::isModifiable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsModifiable").build()).build();
private static final SdkField IS_COLLECTION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IsCollection").getter(getter(OptionSetting::isCollection)).setter(setter(Builder::isCollection))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsCollection").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, VALUE_FIELD,
DEFAULT_VALUE_FIELD, DESCRIPTION_FIELD, APPLY_TYPE_FIELD, DATA_TYPE_FIELD, ALLOWED_VALUES_FIELD, IS_MODIFIABLE_FIELD,
IS_COLLECTION_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String value;
private final String defaultValue;
private final String description;
private final String applyType;
private final String dataType;
private final String allowedValues;
private final Boolean isModifiable;
private final Boolean isCollection;
private OptionSetting(BuilderImpl builder) {
this.name = builder.name;
this.value = builder.value;
this.defaultValue = builder.defaultValue;
this.description = builder.description;
this.applyType = builder.applyType;
this.dataType = builder.dataType;
this.allowedValues = builder.allowedValues;
this.isModifiable = builder.isModifiable;
this.isCollection = builder.isCollection;
}
/**
*
* The name of the option that has settings that you can set.
*
*
* @return The name of the option that has settings that you can set.
*/
public final String name() {
return name;
}
/**
*
* The current value of the option setting.
*
*
* @return The current value of the option setting.
*/
public final String value() {
return value;
}
/**
*
* The default value of the option setting.
*
*
* @return The default value of the option setting.
*/
public final String defaultValue() {
return defaultValue;
}
/**
*
* The description of the option setting.
*
*
* @return The description of the option setting.
*/
public final String description() {
return description;
}
/**
*
* The DB engine specific parameter type.
*
*
* @return The DB engine specific parameter type.
*/
public final String applyType() {
return applyType;
}
/**
*
* The data type of the option setting.
*
*
* @return The data type of the option setting.
*/
public final String dataType() {
return dataType;
}
/**
*
* The allowed values of the option setting.
*
*
* @return The allowed values of the option setting.
*/
public final String allowedValues() {
return allowedValues;
}
/**
*
* Indicates whether the option setting can be modified from the default.
*
*
* @return Indicates whether the option setting can be modified from the default.
*/
public final Boolean isModifiable() {
return isModifiable;
}
/**
*
* Indicates whether the option setting is part of a collection.
*
*
* @return Indicates whether the option setting is part of a collection.
*/
public final Boolean isCollection() {
return isCollection;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(value());
hashCode = 31 * hashCode + Objects.hashCode(defaultValue());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(applyType());
hashCode = 31 * hashCode + Objects.hashCode(dataType());
hashCode = 31 * hashCode + Objects.hashCode(allowedValues());
hashCode = 31 * hashCode + Objects.hashCode(isModifiable());
hashCode = 31 * hashCode + Objects.hashCode(isCollection());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OptionSetting)) {
return false;
}
OptionSetting other = (OptionSetting) obj;
return Objects.equals(name(), other.name()) && Objects.equals(value(), other.value())
&& Objects.equals(defaultValue(), other.defaultValue()) && Objects.equals(description(), other.description())
&& Objects.equals(applyType(), other.applyType()) && Objects.equals(dataType(), other.dataType())
&& Objects.equals(allowedValues(), other.allowedValues()) && Objects.equals(isModifiable(), other.isModifiable())
&& Objects.equals(isCollection(), other.isCollection());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("OptionSetting").add("Name", name()).add("Value", value()).add("DefaultValue", defaultValue())
.add("Description", description()).add("ApplyType", applyType()).add("DataType", dataType())
.add("AllowedValues", allowedValues()).add("IsModifiable", isModifiable()).add("IsCollection", isCollection())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Value":
return Optional.ofNullable(clazz.cast(value()));
case "DefaultValue":
return Optional.ofNullable(clazz.cast(defaultValue()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "ApplyType":
return Optional.ofNullable(clazz.cast(applyType()));
case "DataType":
return Optional.ofNullable(clazz.cast(dataType()));
case "AllowedValues":
return Optional.ofNullable(clazz.cast(allowedValues()));
case "IsModifiable":
return Optional.ofNullable(clazz.cast(isModifiable()));
case "IsCollection":
return Optional.ofNullable(clazz.cast(isCollection()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function