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

software.amazon.awssdk.services.migrationhubstrategy.model.DataCollectionDetails 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.migrationhubstrategy.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;

/**
 * 

* Detailed information about an assessment. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DataCollectionDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField COMPLETION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("completionTime").getter(getter(DataCollectionDetails::completionTime)) .setter(setter(Builder::completionTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("completionTime").build()).build(); private static final SdkField FAILED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("failed").getter(getter(DataCollectionDetails::failed)).setter(setter(Builder::failed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failed").build()).build(); private static final SdkField IN_PROGRESS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("inProgress").getter(getter(DataCollectionDetails::inProgress)).setter(setter(Builder::inProgress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inProgress").build()).build(); private static final SdkField SERVERS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("servers").getter(getter(DataCollectionDetails::servers)).setter(setter(Builder::servers)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("servers").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("startTime").getter(getter(DataCollectionDetails::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(DataCollectionDetails::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("statusMessage").getter(getter(DataCollectionDetails::statusMessage)) .setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusMessage").build()).build(); private static final SdkField SUCCESS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("success").getter(getter(DataCollectionDetails::success)).setter(setter(Builder::success)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("success").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COMPLETION_TIME_FIELD, FAILED_FIELD, IN_PROGRESS_FIELD, SERVERS_FIELD, START_TIME_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD, SUCCESS_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final Instant completionTime; private final Integer failed; private final Integer inProgress; private final Integer servers; private final Instant startTime; private final String status; private final String statusMessage; private final Integer success; private DataCollectionDetails(BuilderImpl builder) { this.completionTime = builder.completionTime; this.failed = builder.failed; this.inProgress = builder.inProgress; this.servers = builder.servers; this.startTime = builder.startTime; this.status = builder.status; this.statusMessage = builder.statusMessage; this.success = builder.success; } /** *

* The time the assessment completes. *

* * @return The time the assessment completes. */ public final Instant completionTime() { return completionTime; } /** *

* The number of failed servers in the assessment. *

* * @return The number of failed servers in the assessment. */ public final Integer failed() { return failed; } /** *

* The number of servers with the assessment status IN_PROGESS. *

* * @return The number of servers with the assessment status IN_PROGESS. */ public final Integer inProgress() { return inProgress; } /** *

* The total number of servers in the assessment. *

* * @return The total number of servers in the assessment. */ public final Integer servers() { return servers; } /** *

* The start time of assessment. *

* * @return The start time of assessment. */ public final Instant startTime() { return startTime; } /** *

* The status of the assessment. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link AssessmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the assessment. * @see AssessmentStatus */ public final AssessmentStatus status() { return AssessmentStatus.fromValue(status); } /** *

* The status of the assessment. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link AssessmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the assessment. * @see AssessmentStatus */ public final String statusAsString() { return status; } /** *

* The status message of the assessment. *

* * @return The status message of the assessment. */ public final String statusMessage() { return statusMessage; } /** *

* The number of successful servers in the assessment. *

* * @return The number of successful servers in the assessment. */ public final Integer success() { return success; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(completionTime()); hashCode = 31 * hashCode + Objects.hashCode(failed()); hashCode = 31 * hashCode + Objects.hashCode(inProgress()); hashCode = 31 * hashCode + Objects.hashCode(servers()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); hashCode = 31 * hashCode + Objects.hashCode(success()); 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 DataCollectionDetails)) { return false; } DataCollectionDetails other = (DataCollectionDetails) obj; return Objects.equals(completionTime(), other.completionTime()) && Objects.equals(failed(), other.failed()) && Objects.equals(inProgress(), other.inProgress()) && Objects.equals(servers(), other.servers()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusMessage(), other.statusMessage()) && Objects.equals(success(), other.success()); } /** * 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("DataCollectionDetails").add("CompletionTime", completionTime()).add("Failed", failed()) .add("InProgress", inProgress()).add("Servers", servers()).add("StartTime", startTime()) .add("Status", statusAsString()).add("StatusMessage", statusMessage()).add("Success", success()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "completionTime": return Optional.ofNullable(clazz.cast(completionTime())); case "failed": return Optional.ofNullable(clazz.cast(failed())); case "inProgress": return Optional.ofNullable(clazz.cast(inProgress())); case "servers": return Optional.ofNullable(clazz.cast(servers())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); case "success": return Optional.ofNullable(clazz.cast(success())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("completionTime", COMPLETION_TIME_FIELD); map.put("failed", FAILED_FIELD); map.put("inProgress", IN_PROGRESS_FIELD); map.put("servers", SERVERS_FIELD); map.put("startTime", START_TIME_FIELD); map.put("status", STATUS_FIELD); map.put("statusMessage", STATUS_MESSAGE_FIELD); map.put("success", SUCCESS_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((DataCollectionDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The time the assessment completes. *

* * @param completionTime * The time the assessment completes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder completionTime(Instant completionTime); /** *

* The number of failed servers in the assessment. *

* * @param failed * The number of failed servers in the assessment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failed(Integer failed); /** *

* The number of servers with the assessment status IN_PROGESS. *

* * @param inProgress * The number of servers with the assessment status IN_PROGESS. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inProgress(Integer inProgress); /** *

* The total number of servers in the assessment. *

* * @param servers * The total number of servers in the assessment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder servers(Integer servers); /** *

* The start time of assessment. *

* * @param startTime * The start time of assessment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The status of the assessment. *

* * @param status * The status of the assessment. * @see AssessmentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AssessmentStatus */ Builder status(String status); /** *

* The status of the assessment. *

* * @param status * The status of the assessment. * @see AssessmentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AssessmentStatus */ Builder status(AssessmentStatus status); /** *

* The status message of the assessment. *

* * @param statusMessage * The status message of the assessment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusMessage(String statusMessage); /** *

* The number of successful servers in the assessment. *

* * @param success * The number of successful servers in the assessment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder success(Integer success); } static final class BuilderImpl implements Builder { private Instant completionTime; private Integer failed; private Integer inProgress; private Integer servers; private Instant startTime; private String status; private String statusMessage; private Integer success; private BuilderImpl() { } private BuilderImpl(DataCollectionDetails model) { completionTime(model.completionTime); failed(model.failed); inProgress(model.inProgress); servers(model.servers); startTime(model.startTime); status(model.status); statusMessage(model.statusMessage); success(model.success); } public final Instant getCompletionTime() { return completionTime; } public final void setCompletionTime(Instant completionTime) { this.completionTime = completionTime; } @Override public final Builder completionTime(Instant completionTime) { this.completionTime = completionTime; return this; } public final Integer getFailed() { return failed; } public final void setFailed(Integer failed) { this.failed = failed; } @Override public final Builder failed(Integer failed) { this.failed = failed; return this; } public final Integer getInProgress() { return inProgress; } public final void setInProgress(Integer inProgress) { this.inProgress = inProgress; } @Override public final Builder inProgress(Integer inProgress) { this.inProgress = inProgress; return this; } public final Integer getServers() { return servers; } public final void setServers(Integer servers) { this.servers = servers; } @Override public final Builder servers(Integer servers) { this.servers = servers; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(AssessmentStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusMessage() { return statusMessage; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } public final Integer getSuccess() { return success; } public final void setSuccess(Integer success) { this.success = success; } @Override public final Builder success(Integer success) { this.success = success; return this; } @Override public DataCollectionDetails build() { return new DataCollectionDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy