
software.amazon.awssdk.services.storagegateway.model.VolumeRecoveryPointInfo 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.storagegateway.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 a storage volume recovery point object.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VolumeRecoveryPointInfo implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VOLUME_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(VolumeRecoveryPointInfo::volumeARN)).setter(setter(Builder::volumeARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeARN").build()).build();
private static final SdkField VOLUME_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(VolumeRecoveryPointInfo::volumeSizeInBytes)).setter(setter(Builder::volumeSizeInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeSizeInBytes").build()).build();
private static final SdkField VOLUME_USAGE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(VolumeRecoveryPointInfo::volumeUsageInBytes)).setter(setter(Builder::volumeUsageInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeUsageInBytes").build())
.build();
private static final SdkField VOLUME_RECOVERY_POINT_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(VolumeRecoveryPointInfo::volumeRecoveryPointTime)).setter(setter(Builder::volumeRecoveryPointTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeRecoveryPointTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOLUME_ARN_FIELD,
VOLUME_SIZE_IN_BYTES_FIELD, VOLUME_USAGE_IN_BYTES_FIELD, VOLUME_RECOVERY_POINT_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String volumeARN;
private final Long volumeSizeInBytes;
private final Long volumeUsageInBytes;
private final String volumeRecoveryPointTime;
private VolumeRecoveryPointInfo(BuilderImpl builder) {
this.volumeARN = builder.volumeARN;
this.volumeSizeInBytes = builder.volumeSizeInBytes;
this.volumeUsageInBytes = builder.volumeUsageInBytes;
this.volumeRecoveryPointTime = builder.volumeRecoveryPointTime;
}
/**
*
* The Amazon Resource Name (ARN) of the volume target.
*
*
* @return The Amazon Resource Name (ARN) of the volume target.
*/
public String volumeARN() {
return volumeARN;
}
/**
*
* The size of the volume in bytes.
*
*
* @return The size of the volume in bytes.
*/
public Long volumeSizeInBytes() {
return volumeSizeInBytes;
}
/**
*
* The size of the data stored on the volume in bytes.
*
*
*
* This value is not available for volumes created prior to May 13, 2015, until you store data on the volume.
*
*
*
* @return The size of the data stored on the volume in bytes.
*
* This value is not available for volumes created prior to May 13, 2015, until you store data on the
* volume.
*
*/
public Long volumeUsageInBytes() {
return volumeUsageInBytes;
}
/**
*
* The time the recovery point was taken.
*
*
* @return The time the recovery point was taken.
*/
public String volumeRecoveryPointTime() {
return volumeRecoveryPointTime;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(volumeARN());
hashCode = 31 * hashCode + Objects.hashCode(volumeSizeInBytes());
hashCode = 31 * hashCode + Objects.hashCode(volumeUsageInBytes());
hashCode = 31 * hashCode + Objects.hashCode(volumeRecoveryPointTime());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VolumeRecoveryPointInfo)) {
return false;
}
VolumeRecoveryPointInfo other = (VolumeRecoveryPointInfo) obj;
return Objects.equals(volumeARN(), other.volumeARN()) && Objects.equals(volumeSizeInBytes(), other.volumeSizeInBytes())
&& Objects.equals(volumeUsageInBytes(), other.volumeUsageInBytes())
&& Objects.equals(volumeRecoveryPointTime(), other.volumeRecoveryPointTime());
}
/**
* 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 String toString() {
return ToString.builder("VolumeRecoveryPointInfo").add("VolumeARN", volumeARN())
.add("VolumeSizeInBytes", volumeSizeInBytes()).add("VolumeUsageInBytes", volumeUsageInBytes())
.add("VolumeRecoveryPointTime", volumeRecoveryPointTime()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VolumeARN":
return Optional.ofNullable(clazz.cast(volumeARN()));
case "VolumeSizeInBytes":
return Optional.ofNullable(clazz.cast(volumeSizeInBytes()));
case "VolumeUsageInBytes":
return Optional.ofNullable(clazz.cast(volumeUsageInBytes()));
case "VolumeRecoveryPointTime":
return Optional.ofNullable(clazz.cast(volumeRecoveryPointTime()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy