All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.neptune.model.UpgradeTarget Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Neptune module holds the client classes that are used for communicating with Neptune.

There is a newer version: 2.29.39
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((UpgradeTarget) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the upgrade target database engine. *

* * @param engine * The name of the upgrade target database engine. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

* The version number of the upgrade target database engine. *

* * @param engineVersion * The version number of the upgrade target database engine. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineVersion(String engineVersion); /** *

* The version of the database engine that a DB instance can be upgraded to. *

* * @param description * The version of the database engine that a DB instance can be upgraded to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* A value that indicates whether the target version is applied to any source DB instances that have * AutoMinorVersionUpgrade set to true. *

* * @param autoUpgrade * A value that indicates whether the target version is applied to any source DB instances that have * AutoMinorVersionUpgrade set to true. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoUpgrade(Boolean autoUpgrade); /** *

* A value that indicates whether a database engine is upgraded to a major version. *

* * @param isMajorVersionUpgrade * A value that indicates whether a database engine is upgraded to a major version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isMajorVersionUpgrade(Boolean isMajorVersionUpgrade); /** *

* A value that indicates whether you can use Neptune global databases with the target engine version. *

* * @param supportsGlobalDatabases * A value that indicates whether you can use Neptune global databases with the target engine version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder supportsGlobalDatabases(Boolean supportsGlobalDatabases); } static final class BuilderImpl implements Builder { private String engine; private String engineVersion; private String description; private Boolean autoUpgrade; private Boolean isMajorVersionUpgrade; private Boolean supportsGlobalDatabases; private BuilderImpl() { } private BuilderImpl(UpgradeTarget model) { engine(model.engine); engineVersion(model.engineVersion); description(model.description); autoUpgrade(model.autoUpgrade); isMajorVersionUpgrade(model.isMajorVersionUpgrade); supportsGlobalDatabases(model.supportsGlobalDatabases); } public final String getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override public final Builder engine(String engine) { this.engine = engine; return this; } public final String getEngineVersion() { return engineVersion; } public final void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; } @Override public final Builder engineVersion(String engineVersion) { this.engineVersion = engineVersion; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Boolean getAutoUpgrade() { return autoUpgrade; } public final void setAutoUpgrade(Boolean autoUpgrade) { this.autoUpgrade = autoUpgrade; } @Override public final Builder autoUpgrade(Boolean autoUpgrade) { this.autoUpgrade = autoUpgrade; return this; } public final Boolean getIsMajorVersionUpgrade() { return isMajorVersionUpgrade; } public final void setIsMajorVersionUpgrade(Boolean isMajorVersionUpgrade) { this.isMajorVersionUpgrade = isMajorVersionUpgrade; } @Override public final Builder isMajorVersionUpgrade(Boolean isMajorVersionUpgrade) { this.isMajorVersionUpgrade = isMajorVersionUpgrade; return this; } public final Boolean getSupportsGlobalDatabases() { return supportsGlobalDatabases; } public final void setSupportsGlobalDatabases(Boolean supportsGlobalDatabases) { this.supportsGlobalDatabases = supportsGlobalDatabases; } @Override public final Builder supportsGlobalDatabases(Boolean supportsGlobalDatabases) { this.supportsGlobalDatabases = supportsGlobalDatabases; return this; } @Override public UpgradeTarget build() { return new UpgradeTarget(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy