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

software.amazon.awssdk.services.storagegateway.model.TapeRecoveryPointInfo Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.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) .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) .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) .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) .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 String tapeARN() { return tapeARN; } /** *

* The time when the point-in-time view of the virtual tape was replicated for later recovery. *

*

* The default time stamp 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 time stamp format of the tape recovery point time is in the ISO8601 extended * YYYY-MM-DD'T'HH:MM:SS'Z' format. */ public 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 Long tapeSizeInBytes() { return tapeSizeInBytes; } /** *

* The status of the virtual tapes. *

* * @return The status of the virtual tapes. */ public String tapeStatus() { return tapeStatus; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public 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 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 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 String toString() { return ToString.builder("TapeRecoveryPointInfo").add("TapeARN", tapeARN()) .add("TapeRecoveryPointTime", tapeRecoveryPointTime()).add("TapeSizeInBytes", tapeSizeInBytes()) .add("TapeStatus", tapeStatus()).build(); } public 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 List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TapeRecoveryPointInfo) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the virtual tape. *

* * @param tapeARN * The Amazon Resource Name (ARN) of the virtual tape. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tapeARN(String tapeARN); /** *

* The time when the point-in-time view of the virtual tape was replicated for later recovery. *

*

* The default time stamp format of the tape recovery point time is in the ISO8601 extended * YYYY-MM-DD'T'HH:MM:SS'Z' format. *

* * @param tapeRecoveryPointTime * The time when the point-in-time view of the virtual tape was replicated for later recovery.

*

* The default time stamp format of the tape recovery point time is in the ISO8601 extended * YYYY-MM-DD'T'HH:MM:SS'Z' format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tapeRecoveryPointTime(Instant tapeRecoveryPointTime); /** *

* The size, in bytes, of the virtual tapes to recover. *

* * @param tapeSizeInBytes * The size, in bytes, of the virtual tapes to recover. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tapeSizeInBytes(Long tapeSizeInBytes); /** *

* The status of the virtual tapes. *

* * @param tapeStatus * The status of the virtual tapes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tapeStatus(String tapeStatus); } static final class BuilderImpl implements Builder { private String tapeARN; private Instant tapeRecoveryPointTime; private Long tapeSizeInBytes; private String tapeStatus; private BuilderImpl() { } private BuilderImpl(TapeRecoveryPointInfo model) { tapeARN(model.tapeARN); tapeRecoveryPointTime(model.tapeRecoveryPointTime); tapeSizeInBytes(model.tapeSizeInBytes); tapeStatus(model.tapeStatus); } public final String getTapeARN() { return tapeARN; } @Override public final Builder tapeARN(String tapeARN) { this.tapeARN = tapeARN; return this; } public final void setTapeARN(String tapeARN) { this.tapeARN = tapeARN; } public final Instant getTapeRecoveryPointTime() { return tapeRecoveryPointTime; } @Override public final Builder tapeRecoveryPointTime(Instant tapeRecoveryPointTime) { this.tapeRecoveryPointTime = tapeRecoveryPointTime; return this; } public final void setTapeRecoveryPointTime(Instant tapeRecoveryPointTime) { this.tapeRecoveryPointTime = tapeRecoveryPointTime; } public final Long getTapeSizeInBytes() { return tapeSizeInBytes; } @Override public final Builder tapeSizeInBytes(Long tapeSizeInBytes) { this.tapeSizeInBytes = tapeSizeInBytes; return this; } public final void setTapeSizeInBytes(Long tapeSizeInBytes) { this.tapeSizeInBytes = tapeSizeInBytes; } public final String getTapeStatus() { return tapeStatus; } @Override public final Builder tapeStatus(String tapeStatus) { this.tapeStatus = tapeStatus; return this; } public final void setTapeStatus(String tapeStatus) { this.tapeStatus = tapeStatus; } @Override public TapeRecoveryPointInfo build() { return new TapeRecoveryPointInfo(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy