software.amazon.awssdk.services.computeoptimizer.model.VolumeConfiguration Maven / Gradle / Ivy
Show all versions of computeoptimizer 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.computeoptimizer.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;
/**
*
* Describes the configuration of an Amazon Elastic Block Store (Amazon EBS) volume.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VolumeConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VOLUME_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("volumeType").getter(getter(VolumeConfiguration::volumeType)).setter(setter(Builder::volumeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeType").build()).build();
private static final SdkField VOLUME_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("volumeSize").getter(getter(VolumeConfiguration::volumeSize)).setter(setter(Builder::volumeSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeSize").build()).build();
private static final SdkField VOLUME_BASELINE_IOPS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("volumeBaselineIOPS").getter(getter(VolumeConfiguration::volumeBaselineIOPS))
.setter(setter(Builder::volumeBaselineIOPS))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeBaselineIOPS").build())
.build();
private static final SdkField VOLUME_BURST_IOPS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("volumeBurstIOPS").getter(getter(VolumeConfiguration::volumeBurstIOPS))
.setter(setter(Builder::volumeBurstIOPS))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeBurstIOPS").build()).build();
private static final SdkField VOLUME_BASELINE_THROUGHPUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("volumeBaselineThroughput").getter(getter(VolumeConfiguration::volumeBaselineThroughput))
.setter(setter(Builder::volumeBaselineThroughput))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeBaselineThroughput").build())
.build();
private static final SdkField VOLUME_BURST_THROUGHPUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("volumeBurstThroughput").getter(getter(VolumeConfiguration::volumeBurstThroughput))
.setter(setter(Builder::volumeBurstThroughput))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeBurstThroughput").build())
.build();
private static final SdkField ROOT_VOLUME_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("rootVolume").getter(getter(VolumeConfiguration::rootVolume)).setter(setter(Builder::rootVolume))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("rootVolume").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOLUME_TYPE_FIELD,
VOLUME_SIZE_FIELD, VOLUME_BASELINE_IOPS_FIELD, VOLUME_BURST_IOPS_FIELD, VOLUME_BASELINE_THROUGHPUT_FIELD,
VOLUME_BURST_THROUGHPUT_FIELD, ROOT_VOLUME_FIELD));
private static final long serialVersionUID = 1L;
private final String volumeType;
private final Integer volumeSize;
private final Integer volumeBaselineIOPS;
private final Integer volumeBurstIOPS;
private final Integer volumeBaselineThroughput;
private final Integer volumeBurstThroughput;
private final Boolean rootVolume;
private VolumeConfiguration(BuilderImpl builder) {
this.volumeType = builder.volumeType;
this.volumeSize = builder.volumeSize;
this.volumeBaselineIOPS = builder.volumeBaselineIOPS;
this.volumeBurstIOPS = builder.volumeBurstIOPS;
this.volumeBaselineThroughput = builder.volumeBaselineThroughput;
this.volumeBurstThroughput = builder.volumeBurstThroughput;
this.rootVolume = builder.rootVolume;
}
/**
*
* The volume type.
*
*
* This can be gp2
for General Purpose SSD, io1
or io2
for Provisioned IOPS
* SSD, st1
for Throughput Optimized HDD, sc1
for Cold HDD, or standard
for
* Magnetic volumes.
*
*
* @return The volume type.
*
* This can be gp2
for General Purpose SSD, io1
or io2
for
* Provisioned IOPS SSD, st1
for Throughput Optimized HDD, sc1
for Cold HDD, or
* standard
for Magnetic volumes.
*/
public final String volumeType() {
return volumeType;
}
/**
*
* The size of the volume, in GiB.
*
*
* @return The size of the volume, in GiB.
*/
public final Integer volumeSize() {
return volumeSize;
}
/**
*
* The baseline IOPS of the volume.
*
*
* @return The baseline IOPS of the volume.
*/
public final Integer volumeBaselineIOPS() {
return volumeBaselineIOPS;
}
/**
*
* The burst IOPS of the volume.
*
*
* @return The burst IOPS of the volume.
*/
public final Integer volumeBurstIOPS() {
return volumeBurstIOPS;
}
/**
*
* The baseline throughput of the volume.
*
*
* @return The baseline throughput of the volume.
*/
public final Integer volumeBaselineThroughput() {
return volumeBaselineThroughput;
}
/**
*
* The burst throughput of the volume.
*
*
* @return The burst throughput of the volume.
*/
public final Integer volumeBurstThroughput() {
return volumeBurstThroughput;
}
/**
*
* Contains the image used to boot the instance during launch.
*
*
* @return Contains the image used to boot the instance during launch.
*/
public final Boolean rootVolume() {
return rootVolume;
}
@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(volumeType());
hashCode = 31 * hashCode + Objects.hashCode(volumeSize());
hashCode = 31 * hashCode + Objects.hashCode(volumeBaselineIOPS());
hashCode = 31 * hashCode + Objects.hashCode(volumeBurstIOPS());
hashCode = 31 * hashCode + Objects.hashCode(volumeBaselineThroughput());
hashCode = 31 * hashCode + Objects.hashCode(volumeBurstThroughput());
hashCode = 31 * hashCode + Objects.hashCode(rootVolume());
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 VolumeConfiguration)) {
return false;
}
VolumeConfiguration other = (VolumeConfiguration) obj;
return Objects.equals(volumeType(), other.volumeType()) && Objects.equals(volumeSize(), other.volumeSize())
&& Objects.equals(volumeBaselineIOPS(), other.volumeBaselineIOPS())
&& Objects.equals(volumeBurstIOPS(), other.volumeBurstIOPS())
&& Objects.equals(volumeBaselineThroughput(), other.volumeBaselineThroughput())
&& Objects.equals(volumeBurstThroughput(), other.volumeBurstThroughput())
&& Objects.equals(rootVolume(), other.rootVolume());
}
/**
* 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("VolumeConfiguration").add("VolumeType", volumeType()).add("VolumeSize", volumeSize())
.add("VolumeBaselineIOPS", volumeBaselineIOPS()).add("VolumeBurstIOPS", volumeBurstIOPS())
.add("VolumeBaselineThroughput", volumeBaselineThroughput())
.add("VolumeBurstThroughput", volumeBurstThroughput()).add("RootVolume", rootVolume()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "volumeType":
return Optional.ofNullable(clazz.cast(volumeType()));
case "volumeSize":
return Optional.ofNullable(clazz.cast(volumeSize()));
case "volumeBaselineIOPS":
return Optional.ofNullable(clazz.cast(volumeBaselineIOPS()));
case "volumeBurstIOPS":
return Optional.ofNullable(clazz.cast(volumeBurstIOPS()));
case "volumeBaselineThroughput":
return Optional.ofNullable(clazz.cast(volumeBaselineThroughput()));
case "volumeBurstThroughput":
return Optional.ofNullable(clazz.cast(volumeBurstThroughput()));
case "rootVolume":
return Optional.ofNullable(clazz.cast(rootVolume()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function