
software.amazon.awssdk.services.storagegateway.model.TapeRecoveryPointInfo 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.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
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 recovery point.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TapeRecoveryPointInfo implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TAPE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TapeARN").getter(getter(TapeRecoveryPointInfo::tapeARN)).setter(setter(Builder::tapeARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeARN").build()).build();
private static final SdkField TAPE_RECOVERY_POINT_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("TapeRecoveryPointTime").getter(getter(TapeRecoveryPointInfo::tapeRecoveryPointTime))
.setter(setter(Builder::tapeRecoveryPointTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeRecoveryPointTime").build())
.build();
private static final SdkField TAPE_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("TapeSizeInBytes").getter(getter(TapeRecoveryPointInfo::tapeSizeInBytes))
.setter(setter(Builder::tapeSizeInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeSizeInBytes").build()).build();
private static final SdkField TAPE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TapeStatus").getter(getter(TapeRecoveryPointInfo::tapeStatus)).setter(setter(Builder::tapeStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeStatus").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TAPE_ARN_FIELD,
TAPE_RECOVERY_POINT_TIME_FIELD, TAPE_SIZE_IN_BYTES_FIELD, TAPE_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final String tapeARN;
private final Instant tapeRecoveryPointTime;
private final Long tapeSizeInBytes;
private final String tapeStatus;
private TapeRecoveryPointInfo(BuilderImpl builder) {
this.tapeARN = builder.tapeARN;
this.tapeRecoveryPointTime = builder.tapeRecoveryPointTime;
this.tapeSizeInBytes = builder.tapeSizeInBytes;
this.tapeStatus = builder.tapeStatus;
}
/**
*
* The Amazon Resource Name (ARN) of the virtual tape.
*
*
* @return The Amazon Resource Name (ARN) of the virtual tape.
*/
public final String tapeARN() {
return tapeARN;
}
/**
*
* The time when the point-in-time view of the virtual tape was replicated for later recovery.
*
*
* The default timestamp format of the tape recovery point time is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z'
* format.
*
*
* @return The time when the point-in-time view of the virtual tape was replicated for later recovery.
*
* The default timestamp format of the tape recovery point time is in the ISO8601 extended
* YYYY-MM-DD'T'HH:MM:SS'Z' format.
*/
public final Instant tapeRecoveryPointTime() {
return tapeRecoveryPointTime;
}
/**
*
* The size, in bytes, of the virtual tapes to recover.
*
*
* @return The size, in bytes, of the virtual tapes to recover.
*/
public final Long tapeSizeInBytes() {
return tapeSizeInBytes;
}
/**
*
* The status of the virtual tapes.
*
*
* @return The status of the virtual tapes.
*/
public final String tapeStatus() {
return tapeStatus;
}
@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(tapeARN());
hashCode = 31 * hashCode + Objects.hashCode(tapeRecoveryPointTime());
hashCode = 31 * hashCode + Objects.hashCode(tapeSizeInBytes());
hashCode = 31 * hashCode + Objects.hashCode(tapeStatus());
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 TapeRecoveryPointInfo)) {
return false;
}
TapeRecoveryPointInfo other = (TapeRecoveryPointInfo) obj;
return Objects.equals(tapeARN(), other.tapeARN())
&& Objects.equals(tapeRecoveryPointTime(), other.tapeRecoveryPointTime())
&& Objects.equals(tapeSizeInBytes(), other.tapeSizeInBytes()) && Objects.equals(tapeStatus(), other.tapeStatus());
}
/**
* 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("TapeRecoveryPointInfo").add("TapeARN", tapeARN())
.add("TapeRecoveryPointTime", tapeRecoveryPointTime()).add("TapeSizeInBytes", tapeSizeInBytes())
.add("TapeStatus", tapeStatus()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TapeARN":
return Optional.ofNullable(clazz.cast(tapeARN()));
case "TapeRecoveryPointTime":
return Optional.ofNullable(clazz.cast(tapeRecoveryPointTime()));
case "TapeSizeInBytes":
return Optional.ofNullable(clazz.cast(tapeSizeInBytes()));
case "TapeStatus":
return Optional.ofNullable(clazz.cast(tapeStatus()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy