software.amazon.awssdk.services.neptunegraph.model.ImportTaskDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptunegraph Show documentation
Show all versions of neptunegraph Show documentation
The AWS Java SDK for Neptune Graph module holds the client classes that are used for
communicating with Neptune Graph.
/*
* 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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy