software.amazon.awssdk.services.neptune.model.UpgradeTarget Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune Show documentation
Show all versions of neptune Show documentation
The AWS Java SDK for Neptune module holds the client classes that are used for
communicating with Neptune.
/*
* 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.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;
/**
*
* The version of the database engine that a DB instance can be upgraded to.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpgradeTarget implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
.getter(getter(UpgradeTarget::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(UpgradeTarget::engineVersion)).setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpgradeTarget::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField AUTO_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoUpgrade").getter(getter(UpgradeTarget::autoUpgrade)).setter(setter(Builder::autoUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoUpgrade").build()).build();
private static final SdkField IS_MAJOR_VERSION_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IsMajorVersionUpgrade").getter(getter(UpgradeTarget::isMajorVersionUpgrade))
.setter(setter(Builder::isMajorVersionUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsMajorVersionUpgrade").build())
.build();
private static final SdkField SUPPORTS_GLOBAL_DATABASES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsGlobalDatabases").getter(getter(UpgradeTarget::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, DESCRIPTION_FIELD, AUTO_UPGRADE_FIELD, IS_MAJOR_VERSION_UPGRADE_FIELD,
SUPPORTS_GLOBAL_DATABASES_FIELD));
private static final long serialVersionUID = 1L;
private final String engine;
private final String engineVersion;
private final String description;
private final Boolean autoUpgrade;
private final Boolean isMajorVersionUpgrade;
private final Boolean supportsGlobalDatabases;
private UpgradeTarget(BuilderImpl builder) {
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.description = builder.description;
this.autoUpgrade = builder.autoUpgrade;
this.isMajorVersionUpgrade = builder.isMajorVersionUpgrade;
this.supportsGlobalDatabases = builder.supportsGlobalDatabases;
}
/**
*
* The name of the upgrade target database engine.
*
*
* @return The name of the upgrade target database engine.
*/
public final String engine() {
return engine;
}
/**
*
* The version number of the upgrade target database engine.
*
*
* @return The version number of the upgrade target database engine.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The version of the database engine that a DB instance can be upgraded to.
*
*
* @return The version of the database engine that a DB instance can be upgraded to.
*/
public final String description() {
return description;
}
/**
*
* A value that indicates whether the target version is applied to any source DB instances that have
* AutoMinorVersionUpgrade set to true.
*
*
* @return A value that indicates whether the target version is applied to any source DB instances that have
* AutoMinorVersionUpgrade set to true.
*/
public final Boolean autoUpgrade() {
return autoUpgrade;
}
/**
*
* A value that indicates whether a database engine is upgraded to a major version.
*
*
* @return A value that indicates whether a database engine is upgraded to a major version.
*/
public final Boolean isMajorVersionUpgrade() {
return isMajorVersionUpgrade;
}
/**
*
* A value that indicates whether you can use Neptune global databases with the target engine version.
*
*
* @return A value that indicates whether you can use Neptune global databases with the target 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(description());
hashCode = 31 * hashCode + Objects.hashCode(autoUpgrade());
hashCode = 31 * hashCode + Objects.hashCode(isMajorVersionUpgrade());
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 UpgradeTarget)) {
return false;
}
UpgradeTarget other = (UpgradeTarget) obj;
return Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(description(), other.description()) && Objects.equals(autoUpgrade(), other.autoUpgrade())
&& Objects.equals(isMajorVersionUpgrade(), other.isMajorVersionUpgrade())
&& 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("UpgradeTarget").add("Engine", engine()).add("EngineVersion", engineVersion())
.add("Description", description()).add("AutoUpgrade", autoUpgrade())
.add("IsMajorVersionUpgrade", isMajorVersionUpgrade()).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 "Description":
return Optional.ofNullable(clazz.cast(description()));
case "AutoUpgrade":
return Optional.ofNullable(clazz.cast(autoUpgrade()));
case "IsMajorVersionUpgrade":
return Optional.ofNullable(clazz.cast(isMajorVersionUpgrade()));
case "SupportsGlobalDatabases":
return Optional.ofNullable(clazz.cast(supportsGlobalDatabases()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy