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

software.amazon.awssdk.services.translate.model.JobDetails Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Translate module holds the client classes that are used for communicating with Amazon Translate Service

There is a newer version: 2.29.17
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.translate.model;

import java.io.Serializable;
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;

/**
 * 

* The number of documents successfully and unsuccessfully processed during a translation job. *

*/ @Generated("software.amazon.awssdk:codegen") public final class JobDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TRANSLATED_DOCUMENTS_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("TranslatedDocumentsCount").getter(getter(JobDetails::translatedDocumentsCount)) .setter(setter(Builder::translatedDocumentsCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TranslatedDocumentsCount").build()) .build(); private static final SdkField DOCUMENTS_WITH_ERRORS_COUNT_FIELD = SdkField . builder(MarshallingType.INTEGER).memberName("DocumentsWithErrorsCount") .getter(getter(JobDetails::documentsWithErrorsCount)).setter(setter(Builder::documentsWithErrorsCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DocumentsWithErrorsCount").build()) .build(); private static final SdkField INPUT_DOCUMENTS_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("InputDocumentsCount").getter(getter(JobDetails::inputDocumentsCount)) .setter(setter(Builder::inputDocumentsCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputDocumentsCount").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( TRANSLATED_DOCUMENTS_COUNT_FIELD, DOCUMENTS_WITH_ERRORS_COUNT_FIELD, INPUT_DOCUMENTS_COUNT_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final Integer translatedDocumentsCount; private final Integer documentsWithErrorsCount; private final Integer inputDocumentsCount; private JobDetails(BuilderImpl builder) { this.translatedDocumentsCount = builder.translatedDocumentsCount; this.documentsWithErrorsCount = builder.documentsWithErrorsCount; this.inputDocumentsCount = builder.inputDocumentsCount; } /** *

* The number of documents successfully processed during a translation job. *

* * @return The number of documents successfully processed during a translation job. */ public final Integer translatedDocumentsCount() { return translatedDocumentsCount; } /** *

* The number of documents that could not be processed during a translation job. *

* * @return The number of documents that could not be processed during a translation job. */ public final Integer documentsWithErrorsCount() { return documentsWithErrorsCount; } /** *

* The number of documents used as input in a translation job. *

* * @return The number of documents used as input in a translation job. */ public final Integer inputDocumentsCount() { return inputDocumentsCount; } @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(translatedDocumentsCount()); hashCode = 31 * hashCode + Objects.hashCode(documentsWithErrorsCount()); hashCode = 31 * hashCode + Objects.hashCode(inputDocumentsCount()); 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 JobDetails)) { return false; } JobDetails other = (JobDetails) obj; return Objects.equals(translatedDocumentsCount(), other.translatedDocumentsCount()) && Objects.equals(documentsWithErrorsCount(), other.documentsWithErrorsCount()) && Objects.equals(inputDocumentsCount(), other.inputDocumentsCount()); } /** * 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("JobDetails").add("TranslatedDocumentsCount", translatedDocumentsCount()) .add("DocumentsWithErrorsCount", documentsWithErrorsCount()).add("InputDocumentsCount", inputDocumentsCount()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TranslatedDocumentsCount": return Optional.ofNullable(clazz.cast(translatedDocumentsCount())); case "DocumentsWithErrorsCount": return Optional.ofNullable(clazz.cast(documentsWithErrorsCount())); case "InputDocumentsCount": return Optional.ofNullable(clazz.cast(inputDocumentsCount())); 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("TranslatedDocumentsCount", TRANSLATED_DOCUMENTS_COUNT_FIELD); map.put("DocumentsWithErrorsCount", DOCUMENTS_WITH_ERRORS_COUNT_FIELD); map.put("InputDocumentsCount", INPUT_DOCUMENTS_COUNT_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((JobDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The number of documents successfully processed during a translation job. *

* * @param translatedDocumentsCount * The number of documents successfully processed during a translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder translatedDocumentsCount(Integer translatedDocumentsCount); /** *

* The number of documents that could not be processed during a translation job. *

* * @param documentsWithErrorsCount * The number of documents that could not be processed during a translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder documentsWithErrorsCount(Integer documentsWithErrorsCount); /** *

* The number of documents used as input in a translation job. *

* * @param inputDocumentsCount * The number of documents used as input in a translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputDocumentsCount(Integer inputDocumentsCount); } static final class BuilderImpl implements Builder { private Integer translatedDocumentsCount; private Integer documentsWithErrorsCount; private Integer inputDocumentsCount; private BuilderImpl() { } private BuilderImpl(JobDetails model) { translatedDocumentsCount(model.translatedDocumentsCount); documentsWithErrorsCount(model.documentsWithErrorsCount); inputDocumentsCount(model.inputDocumentsCount); } public final Integer getTranslatedDocumentsCount() { return translatedDocumentsCount; } public final void setTranslatedDocumentsCount(Integer translatedDocumentsCount) { this.translatedDocumentsCount = translatedDocumentsCount; } @Override public final Builder translatedDocumentsCount(Integer translatedDocumentsCount) { this.translatedDocumentsCount = translatedDocumentsCount; return this; } public final Integer getDocumentsWithErrorsCount() { return documentsWithErrorsCount; } public final void setDocumentsWithErrorsCount(Integer documentsWithErrorsCount) { this.documentsWithErrorsCount = documentsWithErrorsCount; } @Override public final Builder documentsWithErrorsCount(Integer documentsWithErrorsCount) { this.documentsWithErrorsCount = documentsWithErrorsCount; return this; } public final Integer getInputDocumentsCount() { return inputDocumentsCount; } public final void setInputDocumentsCount(Integer inputDocumentsCount) { this.inputDocumentsCount = inputDocumentsCount; } @Override public final Builder inputDocumentsCount(Integer inputDocumentsCount) { this.inputDocumentsCount = inputDocumentsCount; return this; } @Override public JobDetails build() { return new JobDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy