
software.amazon.awssdk.services.guardduty.model.VolumeDetail Maven / Gradle / Ivy
/*
* 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.guardduty.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;
/**
*
* Contains EBS volume details.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VolumeDetail implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField VOLUME_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VolumeArn").getter(getter(VolumeDetail::volumeArn)).setter(setter(Builder::volumeArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeArn").build()).build();
private static final SdkField VOLUME_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VolumeType").getter(getter(VolumeDetail::volumeType)).setter(setter(Builder::volumeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeType").build()).build();
private static final SdkField DEVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceName").getter(getter(VolumeDetail::deviceName)).setter(setter(Builder::deviceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deviceName").build()).build();
private static final SdkField VOLUME_SIZE_IN_GB_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("VolumeSizeInGB").getter(getter(VolumeDetail::volumeSizeInGB)).setter(setter(Builder::volumeSizeInGB))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumeSizeInGB").build()).build();
private static final SdkField ENCRYPTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EncryptionType").getter(getter(VolumeDetail::encryptionType)).setter(setter(Builder::encryptionType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionType").build()).build();
private static final SdkField SNAPSHOT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnapshotArn").getter(getter(VolumeDetail::snapshotArn)).setter(setter(Builder::snapshotArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("snapshotArn").build()).build();
private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyArn").getter(getter(VolumeDetail::kmsKeyArn)).setter(setter(Builder::kmsKeyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOLUME_ARN_FIELD,
VOLUME_TYPE_FIELD, DEVICE_NAME_FIELD, VOLUME_SIZE_IN_GB_FIELD, ENCRYPTION_TYPE_FIELD, SNAPSHOT_ARN_FIELD,
KMS_KEY_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String volumeArn;
private final String volumeType;
private final String deviceName;
private final Integer volumeSizeInGB;
private final String encryptionType;
private final String snapshotArn;
private final String kmsKeyArn;
private VolumeDetail(BuilderImpl builder) {
this.volumeArn = builder.volumeArn;
this.volumeType = builder.volumeType;
this.deviceName = builder.deviceName;
this.volumeSizeInGB = builder.volumeSizeInGB;
this.encryptionType = builder.encryptionType;
this.snapshotArn = builder.snapshotArn;
this.kmsKeyArn = builder.kmsKeyArn;
}
/**
*
* EBS volume Arn information.
*
*
* @return EBS volume Arn information.
*/
public final String volumeArn() {
return volumeArn;
}
/**
*
* The EBS volume type.
*
*
* @return The EBS volume type.
*/
public final String volumeType() {
return volumeType;
}
/**
*
* The device name for the EBS volume.
*
*
* @return The device name for the EBS volume.
*/
public final String deviceName() {
return deviceName;
}
/**
*
* EBS volume size in GB.
*
*
* @return EBS volume size in GB.
*/
public final Integer volumeSizeInGB() {
return volumeSizeInGB;
}
/**
*
* EBS volume encryption type.
*
*
* @return EBS volume encryption type.
*/
public final String encryptionType() {
return encryptionType;
}
/**
*
* Snapshot Arn of the EBS volume.
*
*
* @return Snapshot Arn of the EBS volume.
*/
public final String snapshotArn() {
return snapshotArn;
}
/**
*
* KMS key Arn used to encrypt the EBS volume.
*
*
* @return KMS key Arn used to encrypt the EBS volume.
*/
public final String kmsKeyArn() {
return kmsKeyArn;
}
@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(volumeArn());
hashCode = 31 * hashCode + Objects.hashCode(volumeType());
hashCode = 31 * hashCode + Objects.hashCode(deviceName());
hashCode = 31 * hashCode + Objects.hashCode(volumeSizeInGB());
hashCode = 31 * hashCode + Objects.hashCode(encryptionType());
hashCode = 31 * hashCode + Objects.hashCode(snapshotArn());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn());
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 VolumeDetail)) {
return false;
}
VolumeDetail other = (VolumeDetail) obj;
return Objects.equals(volumeArn(), other.volumeArn()) && Objects.equals(volumeType(), other.volumeType())
&& Objects.equals(deviceName(), other.deviceName()) && Objects.equals(volumeSizeInGB(), other.volumeSizeInGB())
&& Objects.equals(encryptionType(), other.encryptionType()) && Objects.equals(snapshotArn(), other.snapshotArn())
&& Objects.equals(kmsKeyArn(), other.kmsKeyArn());
}
/**
* 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("VolumeDetail").add("VolumeArn", volumeArn()).add("VolumeType", volumeType())
.add("DeviceName", deviceName()).add("VolumeSizeInGB", volumeSizeInGB()).add("EncryptionType", encryptionType())
.add("SnapshotArn", snapshotArn()).add("KmsKeyArn", kmsKeyArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VolumeArn":
return Optional.ofNullable(clazz.cast(volumeArn()));
case "VolumeType":
return Optional.ofNullable(clazz.cast(volumeType()));
case "DeviceName":
return Optional.ofNullable(clazz.cast(deviceName()));
case "VolumeSizeInGB":
return Optional.ofNullable(clazz.cast(volumeSizeInGB()));
case "EncryptionType":
return Optional.ofNullable(clazz.cast(encryptionType()));
case "SnapshotArn":
return Optional.ofNullable(clazz.cast(snapshotArn()));
case "KmsKeyArn":
return Optional.ofNullable(clazz.cast(kmsKeyArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy