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

software.amazon.awssdk.services.neptunegraph.model.ImportTaskDetails Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Neptune Graph module holds the client classes that are used for communicating with Neptune Graph.

There is a newer version: 2.29.39
Show newest version
/*
 * 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.neptunegraph.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;

/**
 * 

* Contains details about an import task. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ImportTaskDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(ImportTaskDetails::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("startTime").getter(getter(ImportTaskDetails::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build(); private static final SdkField TIME_ELAPSED_SECONDS_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("timeElapsedSeconds").getter(getter(ImportTaskDetails::timeElapsedSeconds)) .setter(setter(Builder::timeElapsedSeconds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeElapsedSeconds").build()) .build(); private static final SdkField PROGRESS_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("progressPercentage").getter(getter(ImportTaskDetails::progressPercentage)) .setter(setter(Builder::progressPercentage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("progressPercentage").build()) .build(); private static final SdkField ERROR_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("errorCount").getter(getter(ImportTaskDetails::errorCount)).setter(setter(Builder::errorCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorCount").build()).build(); private static final SdkField ERROR_DETAILS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("errorDetails").getter(getter(ImportTaskDetails::errorDetails)).setter(setter(Builder::errorDetails)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorDetails").build()).build(); private static final SdkField STATEMENT_COUNT_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("statementCount").getter(getter(ImportTaskDetails::statementCount)) .setter(setter(Builder::statementCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statementCount").build()).build(); private static final SdkField DICTIONARY_ENTRY_COUNT_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("dictionaryEntryCount").getter(getter(ImportTaskDetails::dictionaryEntryCount)) .setter(setter(Builder::dictionaryEntryCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dictionaryEntryCount").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STATUS_FIELD, START_TIME_FIELD, TIME_ELAPSED_SECONDS_FIELD, PROGRESS_PERCENTAGE_FIELD, ERROR_COUNT_FIELD, ERROR_DETAILS_FIELD, STATEMENT_COUNT_FIELD, DICTIONARY_ENTRY_COUNT_FIELD)); private static final long serialVersionUID = 1L; private final String status; private final Instant startTime; private final Long timeElapsedSeconds; private final Integer progressPercentage; private final Integer errorCount; private final String errorDetails; private final Long statementCount; private final Long dictionaryEntryCount; private ImportTaskDetails(BuilderImpl builder) { this.status = builder.status; this.startTime = builder.startTime; this.timeElapsedSeconds = builder.timeElapsedSeconds; this.progressPercentage = builder.progressPercentage; this.errorCount = builder.errorCount; this.errorDetails = builder.errorDetails; this.statementCount = builder.statementCount; this.dictionaryEntryCount = builder.dictionaryEntryCount; } /** *

* Status of the import task. *

* * @return Status of the import task. */ public final String status() { return status; } /** *

* Time at which the import task started. *

* * @return Time at which the import task started. */ public final Instant startTime() { return startTime; } /** *

* Seconds elapsed since the import task started. *

* * @return Seconds elapsed since the import task started. */ public final Long timeElapsedSeconds() { return timeElapsedSeconds; } /** *

* The percentage progress so far. *

* * @return The percentage progress so far. */ public final Integer progressPercentage() { return progressPercentage; } /** *

* The number of errors encountered so far. *

* * @return The number of errors encountered so far. */ public final Integer errorCount() { return errorCount; } /** *

* Details about the errors that have been encountered. *

* * @return Details about the errors that have been encountered. */ public final String errorDetails() { return errorDetails; } /** *

* The number of statements in the import task. *

* * @return The number of statements in the import task. */ public final Long statementCount() { return statementCount; } /** *

* The number of dictionary entries in the import task. *

* * @return The number of dictionary entries in the import task. */ public final Long dictionaryEntryCount() { return dictionaryEntryCount; } @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(status()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(timeElapsedSeconds()); hashCode = 31 * hashCode + Objects.hashCode(progressPercentage()); hashCode = 31 * hashCode + Objects.hashCode(errorCount()); hashCode = 31 * hashCode + Objects.hashCode(errorDetails()); hashCode = 31 * hashCode + Objects.hashCode(statementCount()); hashCode = 31 * hashCode + Objects.hashCode(dictionaryEntryCount()); 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 ImportTaskDetails)) { return false; } ImportTaskDetails other = (ImportTaskDetails) obj; return Objects.equals(status(), other.status()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(timeElapsedSeconds(), other.timeElapsedSeconds()) && Objects.equals(progressPercentage(), other.progressPercentage()) && Objects.equals(errorCount(), other.errorCount()) && Objects.equals(errorDetails(), other.errorDetails()) && Objects.equals(statementCount(), other.statementCount()) && Objects.equals(dictionaryEntryCount(), other.dictionaryEntryCount()); } /** * 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("ImportTaskDetails").add("Status", status()).add("StartTime", startTime()) .add("TimeElapsedSeconds", timeElapsedSeconds()).add("ProgressPercentage", progressPercentage()) .add("ErrorCount", errorCount()).add("ErrorDetails", errorDetails()).add("StatementCount", statementCount()) .add("DictionaryEntryCount", dictionaryEntryCount()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "status": return Optional.ofNullable(clazz.cast(status())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); case "timeElapsedSeconds": return Optional.ofNullable(clazz.cast(timeElapsedSeconds())); case "progressPercentage": return Optional.ofNullable(clazz.cast(progressPercentage())); case "errorCount": return Optional.ofNullable(clazz.cast(errorCount())); case "errorDetails": return Optional.ofNullable(clazz.cast(errorDetails())); case "statementCount": return Optional.ofNullable(clazz.cast(statementCount())); case "dictionaryEntryCount": return Optional.ofNullable(clazz.cast(dictionaryEntryCount())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ImportTaskDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Status of the import task. *

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

* Time at which the import task started. *

* * @param startTime * Time at which the import task started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* Seconds elapsed since the import task started. *

* * @param timeElapsedSeconds * Seconds elapsed since the import task started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeElapsedSeconds(Long timeElapsedSeconds); /** *

* The percentage progress so far. *

* * @param progressPercentage * The percentage progress so far. * @return Returns a reference to this object so that method calls can be chained together. */ Builder progressPercentage(Integer progressPercentage); /** *

* The number of errors encountered so far. *

* * @param errorCount * The number of errors encountered so far. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorCount(Integer errorCount); /** *

* Details about the errors that have been encountered. *

* * @param errorDetails * Details about the errors that have been encountered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorDetails(String errorDetails); /** *

* The number of statements in the import task. *

* * @param statementCount * The number of statements in the import task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statementCount(Long statementCount); /** *

* The number of dictionary entries in the import task. *

* * @param dictionaryEntryCount * The number of dictionary entries in the import task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dictionaryEntryCount(Long dictionaryEntryCount); } static final class BuilderImpl implements Builder { private String status; private Instant startTime; private Long timeElapsedSeconds; private Integer progressPercentage; private Integer errorCount; private String errorDetails; private Long statementCount; private Long dictionaryEntryCount; private BuilderImpl() { } private BuilderImpl(ImportTaskDetails model) { status(model.status); startTime(model.startTime); timeElapsedSeconds(model.timeElapsedSeconds); progressPercentage(model.progressPercentage); errorCount(model.errorCount); errorDetails(model.errorDetails); statementCount(model.statementCount); dictionaryEntryCount(model.dictionaryEntryCount); } 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; } 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 Long getTimeElapsedSeconds() { return timeElapsedSeconds; } public final void setTimeElapsedSeconds(Long timeElapsedSeconds) { this.timeElapsedSeconds = timeElapsedSeconds; } @Override public final Builder timeElapsedSeconds(Long timeElapsedSeconds) { this.timeElapsedSeconds = timeElapsedSeconds; return this; } public final Integer getProgressPercentage() { return progressPercentage; } public final void setProgressPercentage(Integer progressPercentage) { this.progressPercentage = progressPercentage; } @Override public final Builder progressPercentage(Integer progressPercentage) { this.progressPercentage = progressPercentage; return this; } public final Integer getErrorCount() { return errorCount; } public final void setErrorCount(Integer errorCount) { this.errorCount = errorCount; } @Override public final Builder errorCount(Integer errorCount) { this.errorCount = errorCount; return this; } public final String getErrorDetails() { return errorDetails; } public final void setErrorDetails(String errorDetails) { this.errorDetails = errorDetails; } @Override public final Builder errorDetails(String errorDetails) { this.errorDetails = errorDetails; return this; } public final Long getStatementCount() { return statementCount; } public final void setStatementCount(Long statementCount) { this.statementCount = statementCount; } @Override public final Builder statementCount(Long statementCount) { this.statementCount = statementCount; return this; } public final Long getDictionaryEntryCount() { return dictionaryEntryCount; } public final void setDictionaryEntryCount(Long dictionaryEntryCount) { this.dictionaryEntryCount = dictionaryEntryCount; } @Override public final Builder dictionaryEntryCount(Long dictionaryEntryCount) { this.dictionaryEntryCount = dictionaryEntryCount; return this; } @Override public ImportTaskDetails build() { return new ImportTaskDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy