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

software.amazon.awssdk.services.neptune.model.ValidStorageOptions 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.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;

/**
 * 

* Information about valid modifications that you can make to your DB instance. *

*

* Contains the result of a successful call to the DescribeValidDBInstanceModifications action. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ValidStorageOptions implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField STORAGE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StorageType").getter(getter(ValidStorageOptions::storageType)).setter(setter(Builder::storageType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageType").build()).build(); private static final SdkField> STORAGE_SIZE_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("StorageSize") .getter(getter(ValidStorageOptions::storageSize)) .setter(setter(Builder::storageSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageSize").build(), ListTrait .builder() .memberLocationName("Range") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Range::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Range").build()).build()).build()).build(); private static final SdkField> PROVISIONED_IOPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ProvisionedIops") .getter(getter(ValidStorageOptions::provisionedIops)) .setter(setter(Builder::provisionedIops)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedIops").build(), ListTrait .builder() .memberLocationName("Range") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Range::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Range").build()).build()).build()).build(); private static final SdkField> IOPS_TO_STORAGE_RATIO_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("IopsToStorageRatio") .getter(getter(ValidStorageOptions::iopsToStorageRatio)) .setter(setter(Builder::iopsToStorageRatio)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IopsToStorageRatio").build(), ListTrait .builder() .memberLocationName("DoubleRange") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(DoubleRange::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("DoubleRange").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STORAGE_TYPE_FIELD, STORAGE_SIZE_FIELD, PROVISIONED_IOPS_FIELD, IOPS_TO_STORAGE_RATIO_FIELD)); private static final long serialVersionUID = 1L; private final String storageType; private final List storageSize; private final List provisionedIops; private final List iopsToStorageRatio; private ValidStorageOptions(BuilderImpl builder) { this.storageType = builder.storageType; this.storageSize = builder.storageSize; this.provisionedIops = builder.provisionedIops; this.iopsToStorageRatio = builder.iopsToStorageRatio; } /** *

* The valid storage types for your DB instance. For example, gp2, io1. *

* * @return The valid storage types for your DB instance. For example, gp2, io1. */ public final String storageType() { return storageType; } /** * For responses, this returns true if the service returned a value for the StorageSize 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 hasStorageSize() { return storageSize != null && !(storageSize instanceof SdkAutoConstructList); } /** *

* The valid range of storage in gibibytes. For example, 100 to 16384. *

*

* 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 #hasStorageSize} method. *

* * @return The valid range of storage in gibibytes. For example, 100 to 16384. */ public final List storageSize() { return storageSize; } /** * For responses, this returns true if the service returned a value for the ProvisionedIops 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 hasProvisionedIops() { return provisionedIops != null && !(provisionedIops instanceof SdkAutoConstructList); } /** *

* The valid range of provisioned IOPS. For example, 1000-20000. *

*

* 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 #hasProvisionedIops} method. *

* * @return The valid range of provisioned IOPS. For example, 1000-20000. */ public final List provisionedIops() { return provisionedIops; } /** * For responses, this returns true if the service returned a value for the IopsToStorageRatio 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 hasIopsToStorageRatio() { return iopsToStorageRatio != null && !(iopsToStorageRatio instanceof SdkAutoConstructList); } /** *

* The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means that * provisioned IOPS can be between 3 and 10 times storage. *

*

* 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 #hasIopsToStorageRatio} method. *

* * @return The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means * that provisioned IOPS can be between 3 and 10 times storage. */ public final List iopsToStorageRatio() { return iopsToStorageRatio; } @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(storageType()); hashCode = 31 * hashCode + Objects.hashCode(hasStorageSize() ? storageSize() : null); hashCode = 31 * hashCode + Objects.hashCode(hasProvisionedIops() ? provisionedIops() : null); hashCode = 31 * hashCode + Objects.hashCode(hasIopsToStorageRatio() ? iopsToStorageRatio() : null); 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 ValidStorageOptions)) { return false; } ValidStorageOptions other = (ValidStorageOptions) obj; return Objects.equals(storageType(), other.storageType()) && hasStorageSize() == other.hasStorageSize() && Objects.equals(storageSize(), other.storageSize()) && hasProvisionedIops() == other.hasProvisionedIops() && Objects.equals(provisionedIops(), other.provisionedIops()) && hasIopsToStorageRatio() == other.hasIopsToStorageRatio() && Objects.equals(iopsToStorageRatio(), other.iopsToStorageRatio()); } /** * 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("ValidStorageOptions").add("StorageType", storageType()) .add("StorageSize", hasStorageSize() ? storageSize() : null) .add("ProvisionedIops", hasProvisionedIops() ? provisionedIops() : null) .add("IopsToStorageRatio", hasIopsToStorageRatio() ? iopsToStorageRatio() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StorageType": return Optional.ofNullable(clazz.cast(storageType())); case "StorageSize": return Optional.ofNullable(clazz.cast(storageSize())); case "ProvisionedIops": return Optional.ofNullable(clazz.cast(provisionedIops())); case "IopsToStorageRatio": return Optional.ofNullable(clazz.cast(iopsToStorageRatio())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ValidStorageOptions) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The valid storage types for your DB instance. For example, gp2, io1. *

* * @param storageType * The valid storage types for your DB instance. For example, gp2, io1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageType(String storageType); /** *

* The valid range of storage in gibibytes. For example, 100 to 16384. *

* * @param storageSize * The valid range of storage in gibibytes. For example, 100 to 16384. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageSize(Collection storageSize); /** *

* The valid range of storage in gibibytes. For example, 100 to 16384. *

* * @param storageSize * The valid range of storage in gibibytes. For example, 100 to 16384. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageSize(Range... storageSize); /** *

* The valid range of storage in gibibytes. For example, 100 to 16384. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #storageSize(List)}. * * @param storageSize * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #storageSize(List) */ Builder storageSize(Consumer... storageSize); /** *

* The valid range of provisioned IOPS. For example, 1000-20000. *

* * @param provisionedIops * The valid range of provisioned IOPS. For example, 1000-20000. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedIops(Collection provisionedIops); /** *

* The valid range of provisioned IOPS. For example, 1000-20000. *

* * @param provisionedIops * The valid range of provisioned IOPS. For example, 1000-20000. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedIops(Range... provisionedIops); /** *

* The valid range of provisioned IOPS. For example, 1000-20000. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #provisionedIops(List)}. * * @param provisionedIops * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #provisionedIops(List) */ Builder provisionedIops(Consumer... provisionedIops); /** *

* The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means that * provisioned IOPS can be between 3 and 10 times storage. *

* * @param iopsToStorageRatio * The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means * that provisioned IOPS can be between 3 and 10 times storage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iopsToStorageRatio(Collection iopsToStorageRatio); /** *

* The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means that * provisioned IOPS can be between 3 and 10 times storage. *

* * @param iopsToStorageRatio * The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means * that provisioned IOPS can be between 3 and 10 times storage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iopsToStorageRatio(DoubleRange... iopsToStorageRatio); /** *

* The valid range of Provisioned IOPS to gibibytes of storage multiplier. For example, 3-10, which means that * provisioned IOPS can be between 3 and 10 times storage. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #iopsToStorageRatio(List)}. * * @param iopsToStorageRatio * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #iopsToStorageRatio(List) */ Builder iopsToStorageRatio(Consumer... iopsToStorageRatio); } static final class BuilderImpl implements Builder { private String storageType; private List storageSize = DefaultSdkAutoConstructList.getInstance(); private List provisionedIops = DefaultSdkAutoConstructList.getInstance(); private List iopsToStorageRatio = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ValidStorageOptions model) { storageType(model.storageType); storageSize(model.storageSize); provisionedIops(model.provisionedIops); iopsToStorageRatio(model.iopsToStorageRatio); } public final String getStorageType() { return storageType; } public final void setStorageType(String storageType) { this.storageType = storageType; } @Override public final Builder storageType(String storageType) { this.storageType = storageType; return this; } public final List getStorageSize() { List result = RangeListCopier.copyToBuilder(this.storageSize); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setStorageSize(Collection storageSize) { this.storageSize = RangeListCopier.copyFromBuilder(storageSize); } @Override public final Builder storageSize(Collection storageSize) { this.storageSize = RangeListCopier.copy(storageSize); return this; } @Override @SafeVarargs public final Builder storageSize(Range... storageSize) { storageSize(Arrays.asList(storageSize)); return this; } @Override @SafeVarargs public final Builder storageSize(Consumer... storageSize) { storageSize(Stream.of(storageSize).map(c -> Range.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getProvisionedIops() { List result = RangeListCopier.copyToBuilder(this.provisionedIops); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setProvisionedIops(Collection provisionedIops) { this.provisionedIops = RangeListCopier.copyFromBuilder(provisionedIops); } @Override public final Builder provisionedIops(Collection provisionedIops) { this.provisionedIops = RangeListCopier.copy(provisionedIops); return this; } @Override @SafeVarargs public final Builder provisionedIops(Range... provisionedIops) { provisionedIops(Arrays.asList(provisionedIops)); return this; } @Override @SafeVarargs public final Builder provisionedIops(Consumer... provisionedIops) { provisionedIops(Stream.of(provisionedIops).map(c -> Range.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getIopsToStorageRatio() { List result = DoubleRangeListCopier.copyToBuilder(this.iopsToStorageRatio); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setIopsToStorageRatio(Collection iopsToStorageRatio) { this.iopsToStorageRatio = DoubleRangeListCopier.copyFromBuilder(iopsToStorageRatio); } @Override public final Builder iopsToStorageRatio(Collection iopsToStorageRatio) { this.iopsToStorageRatio = DoubleRangeListCopier.copy(iopsToStorageRatio); return this; } @Override @SafeVarargs public final Builder iopsToStorageRatio(DoubleRange... iopsToStorageRatio) { iopsToStorageRatio(Arrays.asList(iopsToStorageRatio)); return this; } @Override @SafeVarargs public final Builder iopsToStorageRatio(Consumer... iopsToStorageRatio) { iopsToStorageRatio(Stream.of(iopsToStorageRatio).map(c -> DoubleRange.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } @Override public ValidStorageOptions build() { return new ValidStorageOptions(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy