software.amazon.awssdk.services.neptune.model.DBEngineVersion Maven / Gradle / Ivy
Show all versions of neptune 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.neptune.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* This data type is used as a response element in the action DescribeDBEngineVersions.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DBEngineVersion implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
.getter(getter(DBEngineVersion::engine)).setter(setter(Builder::engine))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineVersion").getter(getter(DBEngineVersion::engineVersion)).setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField DB_PARAMETER_GROUP_FAMILY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBParameterGroupFamily").getter(getter(DBEngineVersion::dbParameterGroupFamily))
.setter(setter(Builder::dbParameterGroupFamily))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBParameterGroupFamily").build())
.build();
private static final SdkField DB_ENGINE_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBEngineDescription").getter(getter(DBEngineVersion::dbEngineDescription))
.setter(setter(Builder::dbEngineDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBEngineDescription").build())
.build();
private static final SdkField DB_ENGINE_VERSION_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DBEngineVersionDescription")
.getter(getter(DBEngineVersion::dbEngineVersionDescription))
.setter(setter(Builder::dbEngineVersionDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBEngineVersionDescription").build())
.build();
private static final SdkField DEFAULT_CHARACTER_SET_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DefaultCharacterSet")
.getter(getter(DBEngineVersion::defaultCharacterSet)).setter(setter(Builder::defaultCharacterSet))
.constructor(CharacterSet::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultCharacterSet").build())
.build();
private static final SdkField> SUPPORTED_CHARACTER_SETS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedCharacterSets")
.getter(getter(DBEngineVersion::supportedCharacterSets))
.setter(setter(Builder::supportedCharacterSets))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedCharacterSets").build(),
ListTrait
.builder()
.memberLocationName("CharacterSet")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(CharacterSet::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("CharacterSet").build()).build()).build()).build();
private static final SdkField> VALID_UPGRADE_TARGET_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ValidUpgradeTarget")
.getter(getter(DBEngineVersion::validUpgradeTarget))
.setter(setter(Builder::validUpgradeTarget))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValidUpgradeTarget").build(),
ListTrait
.builder()
.memberLocationName("UpgradeTarget")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(UpgradeTarget::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("UpgradeTarget").build()).build()).build()).build();
private static final SdkField> SUPPORTED_TIMEZONES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedTimezones")
.getter(getter(DBEngineVersion::supportedTimezones))
.setter(setter(Builder::supportedTimezones))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedTimezones").build(),
ListTrait
.builder()
.memberLocationName("Timezone")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Timezone::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("Timezone").build()).build()).build()).build();
private static final SdkField> EXPORTABLE_LOG_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ExportableLogTypes")
.getter(getter(DBEngineVersion::exportableLogTypes))
.setter(setter(Builder::exportableLogTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExportableLogTypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SUPPORTS_LOG_EXPORTS_TO_CLOUDWATCH_LOGS_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("SupportsLogExportsToCloudwatchLogs")
.getter(getter(DBEngineVersion::supportsLogExportsToCloudwatchLogs))
.setter(setter(Builder::supportsLogExportsToCloudwatchLogs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsLogExportsToCloudwatchLogs")
.build()).build();
private static final SdkField SUPPORTS_READ_REPLICA_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsReadReplica").getter(getter(DBEngineVersion::supportsReadReplica))
.setter(setter(Builder::supportsReadReplica))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsReadReplica").build())
.build();
private static final SdkField SUPPORTS_GLOBAL_DATABASES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsGlobalDatabases").getter(getter(DBEngineVersion::supportsGlobalDatabases))
.setter(setter(Builder::supportsGlobalDatabases))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsGlobalDatabases").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENGINE_FIELD,
ENGINE_VERSION_FIELD, DB_PARAMETER_GROUP_FAMILY_FIELD, DB_ENGINE_DESCRIPTION_FIELD,
DB_ENGINE_VERSION_DESCRIPTION_FIELD, DEFAULT_CHARACTER_SET_FIELD, SUPPORTED_CHARACTER_SETS_FIELD,
VALID_UPGRADE_TARGET_FIELD, SUPPORTED_TIMEZONES_FIELD, EXPORTABLE_LOG_TYPES_FIELD,
SUPPORTS_LOG_EXPORTS_TO_CLOUDWATCH_LOGS_FIELD, SUPPORTS_READ_REPLICA_FIELD, SUPPORTS_GLOBAL_DATABASES_FIELD));
private static final long serialVersionUID = 1L;
private final String engine;
private final String engineVersion;
private final String dbParameterGroupFamily;
private final String dbEngineDescription;
private final String dbEngineVersionDescription;
private final CharacterSet defaultCharacterSet;
private final List supportedCharacterSets;
private final List validUpgradeTarget;
private final List supportedTimezones;
private final List exportableLogTypes;
private final Boolean supportsLogExportsToCloudwatchLogs;
private final Boolean supportsReadReplica;
private final Boolean supportsGlobalDatabases;
private DBEngineVersion(BuilderImpl builder) {
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.dbParameterGroupFamily = builder.dbParameterGroupFamily;
this.dbEngineDescription = builder.dbEngineDescription;
this.dbEngineVersionDescription = builder.dbEngineVersionDescription;
this.defaultCharacterSet = builder.defaultCharacterSet;
this.supportedCharacterSets = builder.supportedCharacterSets;
this.validUpgradeTarget = builder.validUpgradeTarget;
this.supportedTimezones = builder.supportedTimezones;
this.exportableLogTypes = builder.exportableLogTypes;
this.supportsLogExportsToCloudwatchLogs = builder.supportsLogExportsToCloudwatchLogs;
this.supportsReadReplica = builder.supportsReadReplica;
this.supportsGlobalDatabases = builder.supportsGlobalDatabases;
}
/**
*
* The name of the database engine.
*
*
* @return The name of the database engine.
*/
public final String engine() {
return engine;
}
/**
*
* The version number of the database engine.
*
*
* @return The version number of the database engine.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The name of the DB parameter group family for the database engine.
*
*
* @return The name of the DB parameter group family for the database engine.
*/
public final String dbParameterGroupFamily() {
return dbParameterGroupFamily;
}
/**
*
* The description of the database engine.
*
*
* @return The description of the database engine.
*/
public final String dbEngineDescription() {
return dbEngineDescription;
}
/**
*
* The description of the database engine version.
*
*
* @return The description of the database engine version.
*/
public final String dbEngineVersionDescription() {
return dbEngineVersionDescription;
}
/**
*
* (Not supported by Neptune)
*
*
* @return (Not supported by Neptune)
*/
public final CharacterSet defaultCharacterSet() {
return defaultCharacterSet;
}
/**
* For responses, this returns true if the service returned a value for the SupportedCharacterSets property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasSupportedCharacterSets() {
return supportedCharacterSets != null && !(supportedCharacterSets instanceof SdkAutoConstructList);
}
/**
*
* (Not supported by Neptune)
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSupportedCharacterSets} method.
*
*
* @return (Not supported by Neptune)
*/
public final List supportedCharacterSets() {
return supportedCharacterSets;
}
/**
* For responses, this returns true if the service returned a value for the ValidUpgradeTarget property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasValidUpgradeTarget() {
return validUpgradeTarget != null && !(validUpgradeTarget instanceof SdkAutoConstructList);
}
/**
*
* A list of engine versions that this database engine version can be upgraded to.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasValidUpgradeTarget} method.
*
*
* @return A list of engine versions that this database engine version can be upgraded to.
*/
public final List validUpgradeTarget() {
return validUpgradeTarget;
}
/**
* For responses, this returns true if the service returned a value for the SupportedTimezones property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasSupportedTimezones() {
return supportedTimezones != null && !(supportedTimezones instanceof SdkAutoConstructList);
}
/**
*
* A list of the time zones supported by this engine for the Timezone
parameter of the
* CreateDBInstance
action.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSupportedTimezones} method.
*
*
* @return A list of the time zones supported by this engine for the Timezone
parameter of the
* CreateDBInstance
action.
*/
public final List supportedTimezones() {
return supportedTimezones;
}
/**
* For responses, this returns true if the service returned a value for the ExportableLogTypes property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasExportableLogTypes() {
return exportableLogTypes != null && !(exportableLogTypes instanceof SdkAutoConstructList);
}
/**
*
* The types of logs that the database engine has available for export to CloudWatch Logs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasExportableLogTypes} method.
*
*
* @return The types of logs that the database engine has available for export to CloudWatch Logs.
*/
public final List exportableLogTypes() {
return exportableLogTypes;
}
/**
*
* A value that indicates whether the engine version supports exporting the log types specified by
* ExportableLogTypes to CloudWatch Logs.
*
*
* @return A value that indicates whether the engine version supports exporting the log types specified by
* ExportableLogTypes to CloudWatch Logs.
*/
public final Boolean supportsLogExportsToCloudwatchLogs() {
return supportsLogExportsToCloudwatchLogs;
}
/**
*
* Indicates whether the database engine version supports read replicas.
*
*
* @return Indicates whether the database engine version supports read replicas.
*/
public final Boolean supportsReadReplica() {
return supportsReadReplica;
}
/**
*
* A value that indicates whether you can use Aurora global databases with a specific DB engine version.
*
*
* @return A value that indicates whether you can use Aurora global databases with a specific DB engine version.
*/
public final Boolean supportsGlobalDatabases() {
return supportsGlobalDatabases;
}
@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(engine());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(dbParameterGroupFamily());
hashCode = 31 * hashCode + Objects.hashCode(dbEngineDescription());
hashCode = 31 * hashCode + Objects.hashCode(dbEngineVersionDescription());
hashCode = 31 * hashCode + Objects.hashCode(defaultCharacterSet());
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedCharacterSets() ? supportedCharacterSets() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasValidUpgradeTarget() ? validUpgradeTarget() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedTimezones() ? supportedTimezones() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasExportableLogTypes() ? exportableLogTypes() : null);
hashCode = 31 * hashCode + Objects.hashCode(supportsLogExportsToCloudwatchLogs());
hashCode = 31 * hashCode + Objects.hashCode(supportsReadReplica());
hashCode = 31 * hashCode + Objects.hashCode(supportsGlobalDatabases());
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 DBEngineVersion)) {
return false;
}
DBEngineVersion other = (DBEngineVersion) obj;
return Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(dbParameterGroupFamily(), other.dbParameterGroupFamily())
&& Objects.equals(dbEngineDescription(), other.dbEngineDescription())
&& Objects.equals(dbEngineVersionDescription(), other.dbEngineVersionDescription())
&& Objects.equals(defaultCharacterSet(), other.defaultCharacterSet())
&& hasSupportedCharacterSets() == other.hasSupportedCharacterSets()
&& Objects.equals(supportedCharacterSets(), other.supportedCharacterSets())
&& hasValidUpgradeTarget() == other.hasValidUpgradeTarget()
&& Objects.equals(validUpgradeTarget(), other.validUpgradeTarget())
&& hasSupportedTimezones() == other.hasSupportedTimezones()
&& Objects.equals(supportedTimezones(), other.supportedTimezones())
&& hasExportableLogTypes() == other.hasExportableLogTypes()
&& Objects.equals(exportableLogTypes(), other.exportableLogTypes())
&& Objects.equals(supportsLogExportsToCloudwatchLogs(), other.supportsLogExportsToCloudwatchLogs())
&& Objects.equals(supportsReadReplica(), other.supportsReadReplica())
&& Objects.equals(supportsGlobalDatabases(), other.supportsGlobalDatabases());
}
/**
* 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("DBEngineVersion").add("Engine", engine()).add("EngineVersion", engineVersion())
.add("DBParameterGroupFamily", dbParameterGroupFamily()).add("DBEngineDescription", dbEngineDescription())
.add("DBEngineVersionDescription", dbEngineVersionDescription())
.add("DefaultCharacterSet", defaultCharacterSet())
.add("SupportedCharacterSets", hasSupportedCharacterSets() ? supportedCharacterSets() : null)
.add("ValidUpgradeTarget", hasValidUpgradeTarget() ? validUpgradeTarget() : null)
.add("SupportedTimezones", hasSupportedTimezones() ? supportedTimezones() : null)
.add("ExportableLogTypes", hasExportableLogTypes() ? exportableLogTypes() : null)
.add("SupportsLogExportsToCloudwatchLogs", supportsLogExportsToCloudwatchLogs())
.add("SupportsReadReplica", supportsReadReplica()).add("SupportsGlobalDatabases", supportsGlobalDatabases())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "DBParameterGroupFamily":
return Optional.ofNullable(clazz.cast(dbParameterGroupFamily()));
case "DBEngineDescription":
return Optional.ofNullable(clazz.cast(dbEngineDescription()));
case "DBEngineVersionDescription":
return Optional.ofNullable(clazz.cast(dbEngineVersionDescription()));
case "DefaultCharacterSet":
return Optional.ofNullable(clazz.cast(defaultCharacterSet()));
case "SupportedCharacterSets":
return Optional.ofNullable(clazz.cast(supportedCharacterSets()));
case "ValidUpgradeTarget":
return Optional.ofNullable(clazz.cast(validUpgradeTarget()));
case "SupportedTimezones":
return Optional.ofNullable(clazz.cast(supportedTimezones()));
case "ExportableLogTypes":
return Optional.ofNullable(clazz.cast(exportableLogTypes()));
case "SupportsLogExportsToCloudwatchLogs":
return Optional.ofNullable(clazz.cast(supportsLogExportsToCloudwatchLogs()));
case "SupportsReadReplica":
return Optional.ofNullable(clazz.cast(supportsReadReplica()));
case "SupportsGlobalDatabases":
return Optional.ofNullable(clazz.cast(supportsGlobalDatabases()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function