
software.amazon.awssdk.services.drs.model.LifeCycle 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.drs.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.Consumer;
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;
/**
*
* An object representing the Source Server Lifecycle.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LifeCycle implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ADDED_TO_SERVICE_DATE_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("addedToServiceDateTime").getter(getter(LifeCycle::addedToServiceDateTime))
.setter(setter(Builder::addedToServiceDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("addedToServiceDateTime").build())
.build();
private static final SdkField ELAPSED_REPLICATION_DURATION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("elapsedReplicationDuration")
.getter(getter(LifeCycle::elapsedReplicationDuration))
.setter(setter(Builder::elapsedReplicationDuration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("elapsedReplicationDuration").build())
.build();
private static final SdkField FIRST_BYTE_DATE_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("firstByteDateTime").getter(getter(LifeCycle::firstByteDateTime))
.setter(setter(Builder::firstByteDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("firstByteDateTime").build()).build();
private static final SdkField LAST_LAUNCH_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("lastLaunch")
.getter(getter(LifeCycle::lastLaunch)).setter(setter(Builder::lastLaunch)).constructor(LifeCycleLastLaunch::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastLaunch").build()).build();
private static final SdkField LAST_SEEN_BY_SERVICE_DATE_TIME_FIELD = SdkField
. builder(MarshallingType.STRING).memberName("lastSeenByServiceDateTime")
.getter(getter(LifeCycle::lastSeenByServiceDateTime)).setter(setter(Builder::lastSeenByServiceDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastSeenByServiceDateTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
ADDED_TO_SERVICE_DATE_TIME_FIELD, ELAPSED_REPLICATION_DURATION_FIELD, FIRST_BYTE_DATE_TIME_FIELD, LAST_LAUNCH_FIELD,
LAST_SEEN_BY_SERVICE_DATE_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String addedToServiceDateTime;
private final String elapsedReplicationDuration;
private final String firstByteDateTime;
private final LifeCycleLastLaunch lastLaunch;
private final String lastSeenByServiceDateTime;
private LifeCycle(BuilderImpl builder) {
this.addedToServiceDateTime = builder.addedToServiceDateTime;
this.elapsedReplicationDuration = builder.elapsedReplicationDuration;
this.firstByteDateTime = builder.firstByteDateTime;
this.lastLaunch = builder.lastLaunch;
this.lastSeenByServiceDateTime = builder.lastSeenByServiceDateTime;
}
/**
*
* The date and time of when the Source Server was added to the service.
*
*
* @return The date and time of when the Source Server was added to the service.
*/
public final String addedToServiceDateTime() {
return addedToServiceDateTime;
}
/**
*
* The amount of time that the Source Server has been replicating for.
*
*
* @return The amount of time that the Source Server has been replicating for.
*/
public final String elapsedReplicationDuration() {
return elapsedReplicationDuration;
}
/**
*
* The date and time of the first byte that was replicated from the Source Server.
*
*
* @return The date and time of the first byte that was replicated from the Source Server.
*/
public final String firstByteDateTime() {
return firstByteDateTime;
}
/**
*
* An object containing information regarding the last launch of the Source Server.
*
*
* @return An object containing information regarding the last launch of the Source Server.
*/
public final LifeCycleLastLaunch lastLaunch() {
return lastLaunch;
}
/**
*
* The date and time this Source Server was last seen by the service.
*
*
* @return The date and time this Source Server was last seen by the service.
*/
public final String lastSeenByServiceDateTime() {
return lastSeenByServiceDateTime;
}
@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(addedToServiceDateTime());
hashCode = 31 * hashCode + Objects.hashCode(elapsedReplicationDuration());
hashCode = 31 * hashCode + Objects.hashCode(firstByteDateTime());
hashCode = 31 * hashCode + Objects.hashCode(lastLaunch());
hashCode = 31 * hashCode + Objects.hashCode(lastSeenByServiceDateTime());
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 LifeCycle)) {
return false;
}
LifeCycle other = (LifeCycle) obj;
return Objects.equals(addedToServiceDateTime(), other.addedToServiceDateTime())
&& Objects.equals(elapsedReplicationDuration(), other.elapsedReplicationDuration())
&& Objects.equals(firstByteDateTime(), other.firstByteDateTime())
&& Objects.equals(lastLaunch(), other.lastLaunch())
&& Objects.equals(lastSeenByServiceDateTime(), other.lastSeenByServiceDateTime());
}
/**
* 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("LifeCycle").add("AddedToServiceDateTime", addedToServiceDateTime())
.add("ElapsedReplicationDuration", elapsedReplicationDuration()).add("FirstByteDateTime", firstByteDateTime())
.add("LastLaunch", lastLaunch()).add("LastSeenByServiceDateTime", lastSeenByServiceDateTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "addedToServiceDateTime":
return Optional.ofNullable(clazz.cast(addedToServiceDateTime()));
case "elapsedReplicationDuration":
return Optional.ofNullable(clazz.cast(elapsedReplicationDuration()));
case "firstByteDateTime":
return Optional.ofNullable(clazz.cast(firstByteDateTime()));
case "lastLaunch":
return Optional.ofNullable(clazz.cast(lastLaunch()));
case "lastSeenByServiceDateTime":
return Optional.ofNullable(clazz.cast(lastSeenByServiceDateTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy