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

software.amazon.awssdk.services.transcribe.model.VocabularyInfo Maven / Gradle / Ivy

Go to download

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

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

/**
 * 

* Provides information about a custom vocabulary. *

*/ @Generated("software.amazon.awssdk:codegen") public final class VocabularyInfo implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(VocabularyInfo::vocabularyName)).setter(setter(Builder::vocabularyName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyName").build()).build(); private static final SdkField LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(VocabularyInfo::languageCodeAsString)).setter(setter(Builder::languageCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LanguageCode").build()).build(); private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(VocabularyInfo::lastModifiedTime)).setter(setter(Builder::lastModifiedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build(); private static final SdkField VOCABULARY_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(VocabularyInfo::vocabularyStateAsString)).setter(setter(Builder::vocabularyState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyState").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOCABULARY_NAME_FIELD, LANGUAGE_CODE_FIELD, LAST_MODIFIED_TIME_FIELD, VOCABULARY_STATE_FIELD)); private static final long serialVersionUID = 1L; private final String vocabularyName; private final String languageCode; private final Instant lastModifiedTime; private final String vocabularyState; private VocabularyInfo(BuilderImpl builder) { this.vocabularyName = builder.vocabularyName; this.languageCode = builder.languageCode; this.lastModifiedTime = builder.lastModifiedTime; this.vocabularyState = builder.vocabularyState; } /** *

* The name of the vocabulary. *

* * @return The name of the vocabulary. */ public String vocabularyName() { return vocabularyName; } /** *

* The language code of the vocabulary entries. *

*

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

* * @return The language code of the vocabulary entries. * @see LanguageCode */ public LanguageCode languageCode() { return LanguageCode.fromValue(languageCode); } /** *

* The language code of the vocabulary entries. *

*

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

* * @return The language code of the vocabulary entries. * @see LanguageCode */ public String languageCodeAsString() { return languageCode; } /** *

* The date and time that the vocabulary was last modified. *

* * @return The date and time that the vocabulary was last modified. */ public Instant lastModifiedTime() { return lastModifiedTime; } /** *

* The processing state of the vocabulary. If the state is READY you can use the vocabulary in a * StartTranscriptionJob request. *

*

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

* * @return The processing state of the vocabulary. If the state is READY you can use the vocabulary in * a StartTranscriptionJob request. * @see VocabularyState */ public VocabularyState vocabularyState() { return VocabularyState.fromValue(vocabularyState); } /** *

* The processing state of the vocabulary. If the state is READY you can use the vocabulary in a * StartTranscriptionJob request. *

*

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

* * @return The processing state of the vocabulary. If the state is READY you can use the vocabulary in * a StartTranscriptionJob request. * @see VocabularyState */ public String vocabularyStateAsString() { return vocabularyState; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(vocabularyName()); hashCode = 31 * hashCode + Objects.hashCode(languageCodeAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(vocabularyStateAsString()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VocabularyInfo)) { return false; } VocabularyInfo other = (VocabularyInfo) obj; return Objects.equals(vocabularyName(), other.vocabularyName()) && Objects.equals(languageCodeAsString(), other.languageCodeAsString()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(vocabularyStateAsString(), other.vocabularyStateAsString()); } /** * 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 String toString() { return ToString.builder("VocabularyInfo").add("VocabularyName", vocabularyName()) .add("LanguageCode", languageCodeAsString()).add("LastModifiedTime", lastModifiedTime()) .add("VocabularyState", vocabularyStateAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "VocabularyName": return Optional.ofNullable(clazz.cast(vocabularyName())); case "LanguageCode": return Optional.ofNullable(clazz.cast(languageCodeAsString())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "VocabularyState": return Optional.ofNullable(clazz.cast(vocabularyStateAsString())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((VocabularyInfo) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the vocabulary. *

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

* The language code of the vocabulary entries. *

* * @param languageCode * The language code of the vocabulary entries. * @see LanguageCode * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ Builder languageCode(String languageCode); /** *

* The language code of the vocabulary entries. *

* * @param languageCode * The language code of the vocabulary entries. * @see LanguageCode * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ Builder languageCode(LanguageCode languageCode); /** *

* The date and time that the vocabulary was last modified. *

* * @param lastModifiedTime * The date and time that the vocabulary was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); /** *

* The processing state of the vocabulary. If the state is READY you can use the vocabulary in a * StartTranscriptionJob request. *

* * @param vocabularyState * The processing state of the vocabulary. If the state is READY you can use the vocabulary * in a StartTranscriptionJob request. * @see VocabularyState * @return Returns a reference to this object so that method calls can be chained together. * @see VocabularyState */ Builder vocabularyState(String vocabularyState); /** *

* The processing state of the vocabulary. If the state is READY you can use the vocabulary in a * StartTranscriptionJob request. *

* * @param vocabularyState * The processing state of the vocabulary. If the state is READY you can use the vocabulary * in a StartTranscriptionJob request. * @see VocabularyState * @return Returns a reference to this object so that method calls can be chained together. * @see VocabularyState */ Builder vocabularyState(VocabularyState vocabularyState); } static final class BuilderImpl implements Builder { private String vocabularyName; private String languageCode; private Instant lastModifiedTime; private String vocabularyState; private BuilderImpl() { } private BuilderImpl(VocabularyInfo model) { vocabularyName(model.vocabularyName); languageCode(model.languageCode); lastModifiedTime(model.lastModifiedTime); vocabularyState(model.vocabularyState); } public final String getVocabularyName() { return vocabularyName; } @Override public final Builder vocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; return this; } public final void setVocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; } public final String getLanguageCodeAsString() { return languageCode; } @Override public final Builder languageCode(String languageCode) { this.languageCode = languageCode; return this; } @Override public final Builder languageCode(LanguageCode languageCode) { this.languageCode(languageCode == null ? null : languageCode.toString()); return this; } public final void setLanguageCode(String languageCode) { this.languageCode = languageCode; } public final Instant getLastModifiedTime() { return lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } public final String getVocabularyStateAsString() { return vocabularyState; } @Override public final Builder vocabularyState(String vocabularyState) { this.vocabularyState = vocabularyState; return this; } @Override public final Builder vocabularyState(VocabularyState vocabularyState) { this.vocabularyState(vocabularyState == null ? null : vocabularyState.toString()); return this; } public final void setVocabularyState(String vocabularyState) { this.vocabularyState = vocabularyState; } @Override public VocabularyInfo build() { return new VocabularyInfo(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy