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

com.google.cloud.translate.v3beta1.TranslateTextResponse Maven / Gradle / Ivy

/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/translate/v3beta1/translation_service.proto

// Protobuf Java Version: 3.25.2
package com.google.cloud.translate.v3beta1;

/** Protobuf type {@code google.cloud.translation.v3beta1.TranslateTextResponse} */
public final class TranslateTextResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.TranslateTextResponse)
    TranslateTextResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TranslateTextResponse.newBuilder() to construct.
  private TranslateTextResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    super(builder);
  }

  private TranslateTextResponse() {
    translations_ = java.util.Collections.emptyList();
    glossaryTranslations_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new TranslateTextResponse();
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.translate.v3beta1.TranslationServiceProto
        .internal_static_google_cloud_translation_v3beta1_TranslateTextResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.translate.v3beta1.TranslationServiceProto
        .internal_static_google_cloud_translation_v3beta1_TranslateTextResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.translate.v3beta1.TranslateTextResponse.class,
            com.google.cloud.translate.v3beta1.TranslateTextResponse.Builder.class);
  }

  public static final int TRANSLATIONS_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private java.util.List translations_;
  /**
   *
   *
   * 
   * Text translation responses with no glossary applied.
   * This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ @java.lang.Override public java.util.List getTranslationsList() { return translations_; } /** * * *
   * Text translation responses with no glossary applied.
   * This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ @java.lang.Override public java.util.List getTranslationsOrBuilderList() { return translations_; } /** * * *
   * Text translation responses with no glossary applied.
   * This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ @java.lang.Override public int getTranslationsCount() { return translations_.size(); } /** * * *
   * Text translation responses with no glossary applied.
   * This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ @java.lang.Override public com.google.cloud.translate.v3beta1.Translation getTranslations(int index) { return translations_.get(index); } /** * * *
   * Text translation responses with no glossary applied.
   * This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ @java.lang.Override public com.google.cloud.translate.v3beta1.TranslationOrBuilder getTranslationsOrBuilder( int index) { return translations_.get(index); } public static final int GLOSSARY_TRANSLATIONS_FIELD_NUMBER = 3; @SuppressWarnings("serial") private java.util.List glossaryTranslations_; /** * * *
   * Text translation responses if a glossary is provided in the request.
   * This can be the same as
   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
   * if no terms apply. This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; */ @java.lang.Override public java.util.List getGlossaryTranslationsList() { return glossaryTranslations_; } /** * * *
   * Text translation responses if a glossary is provided in the request.
   * This can be the same as
   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
   * if no terms apply. This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; */ @java.lang.Override public java.util.List getGlossaryTranslationsOrBuilderList() { return glossaryTranslations_; } /** * * *
   * Text translation responses if a glossary is provided in the request.
   * This can be the same as
   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
   * if no terms apply. This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; */ @java.lang.Override public int getGlossaryTranslationsCount() { return glossaryTranslations_.size(); } /** * * *
   * Text translation responses if a glossary is provided in the request.
   * This can be the same as
   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
   * if no terms apply. This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; */ @java.lang.Override public com.google.cloud.translate.v3beta1.Translation getGlossaryTranslations(int index) { return glossaryTranslations_.get(index); } /** * * *
   * Text translation responses if a glossary is provided in the request.
   * This can be the same as
   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
   * if no terms apply. This field has the same length as
   * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
   * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; */ @java.lang.Override public com.google.cloud.translate.v3beta1.TranslationOrBuilder getGlossaryTranslationsOrBuilder( int index) { return glossaryTranslations_.get(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < translations_.size(); i++) { output.writeMessage(1, translations_.get(i)); } for (int i = 0; i < glossaryTranslations_.size(); i++) { output.writeMessage(3, glossaryTranslations_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < translations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, translations_.get(i)); } for (int i = 0; i < glossaryTranslations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, glossaryTranslations_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.translate.v3beta1.TranslateTextResponse)) { return super.equals(obj); } com.google.cloud.translate.v3beta1.TranslateTextResponse other = (com.google.cloud.translate.v3beta1.TranslateTextResponse) obj; if (!getTranslationsList().equals(other.getTranslationsList())) return false; if (!getGlossaryTranslationsList().equals(other.getGlossaryTranslationsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getTranslationsCount() > 0) { hash = (37 * hash) + TRANSLATIONS_FIELD_NUMBER; hash = (53 * hash) + getTranslationsList().hashCode(); } if (getGlossaryTranslationsCount() > 0) { hash = (37 * hash) + GLOSSARY_TRANSLATIONS_FIELD_NUMBER; hash = (53 * hash) + getGlossaryTranslationsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.translate.v3beta1.TranslateTextResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** Protobuf type {@code google.cloud.translation.v3beta1.TranslateTextResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.TranslateTextResponse) com.google.cloud.translate.v3beta1.TranslateTextResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateTextResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateTextResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.translate.v3beta1.TranslateTextResponse.class, com.google.cloud.translate.v3beta1.TranslateTextResponse.Builder.class); } // Construct using com.google.cloud.translate.v3beta1.TranslateTextResponse.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (translationsBuilder_ == null) { translations_ = java.util.Collections.emptyList(); } else { translations_ = null; translationsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); if (glossaryTranslationsBuilder_ == null) { glossaryTranslations_ = java.util.Collections.emptyList(); } else { glossaryTranslations_ = null; glossaryTranslationsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateTextResponse_descriptor; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextResponse getDefaultInstanceForType() { return com.google.cloud.translate.v3beta1.TranslateTextResponse.getDefaultInstance(); } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextResponse build() { com.google.cloud.translate.v3beta1.TranslateTextResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextResponse buildPartial() { com.google.cloud.translate.v3beta1.TranslateTextResponse result = new com.google.cloud.translate.v3beta1.TranslateTextResponse(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.cloud.translate.v3beta1.TranslateTextResponse result) { if (translationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { translations_ = java.util.Collections.unmodifiableList(translations_); bitField0_ = (bitField0_ & ~0x00000001); } result.translations_ = translations_; } else { result.translations_ = translationsBuilder_.build(); } if (glossaryTranslationsBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { glossaryTranslations_ = java.util.Collections.unmodifiableList(glossaryTranslations_); bitField0_ = (bitField0_ & ~0x00000002); } result.glossaryTranslations_ = glossaryTranslations_; } else { result.glossaryTranslations_ = glossaryTranslationsBuilder_.build(); } } private void buildPartial0(com.google.cloud.translate.v3beta1.TranslateTextResponse result) { int from_bitField0_ = bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.translate.v3beta1.TranslateTextResponse) { return mergeFrom((com.google.cloud.translate.v3beta1.TranslateTextResponse) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.translate.v3beta1.TranslateTextResponse other) { if (other == com.google.cloud.translate.v3beta1.TranslateTextResponse.getDefaultInstance()) return this; if (translationsBuilder_ == null) { if (!other.translations_.isEmpty()) { if (translations_.isEmpty()) { translations_ = other.translations_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureTranslationsIsMutable(); translations_.addAll(other.translations_); } onChanged(); } } else { if (!other.translations_.isEmpty()) { if (translationsBuilder_.isEmpty()) { translationsBuilder_.dispose(); translationsBuilder_ = null; translations_ = other.translations_; bitField0_ = (bitField0_ & ~0x00000001); translationsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTranslationsFieldBuilder() : null; } else { translationsBuilder_.addAllMessages(other.translations_); } } } if (glossaryTranslationsBuilder_ == null) { if (!other.glossaryTranslations_.isEmpty()) { if (glossaryTranslations_.isEmpty()) { glossaryTranslations_ = other.glossaryTranslations_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.addAll(other.glossaryTranslations_); } onChanged(); } } else { if (!other.glossaryTranslations_.isEmpty()) { if (glossaryTranslationsBuilder_.isEmpty()) { glossaryTranslationsBuilder_.dispose(); glossaryTranslationsBuilder_ = null; glossaryTranslations_ = other.glossaryTranslations_; bitField0_ = (bitField0_ & ~0x00000002); glossaryTranslationsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getGlossaryTranslationsFieldBuilder() : null; } else { glossaryTranslationsBuilder_.addAllMessages(other.glossaryTranslations_); } } } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { com.google.cloud.translate.v3beta1.Translation m = input.readMessage( com.google.cloud.translate.v3beta1.Translation.parser(), extensionRegistry); if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); translations_.add(m); } else { translationsBuilder_.addMessage(m); } break; } // case 10 case 26: { com.google.cloud.translate.v3beta1.Translation m = input.readMessage( com.google.cloud.translate.v3beta1.Translation.parser(), extensionRegistry); if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.add(m); } else { glossaryTranslationsBuilder_.addMessage(m); } break; } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.util.List translations_ = java.util.Collections.emptyList(); private void ensureTranslationsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { translations_ = new java.util.ArrayList(translations_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder> translationsBuilder_; /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public java.util.List getTranslationsList() { if (translationsBuilder_ == null) { return java.util.Collections.unmodifiableList(translations_); } else { return translationsBuilder_.getMessageList(); } } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public int getTranslationsCount() { if (translationsBuilder_ == null) { return translations_.size(); } else { return translationsBuilder_.getCount(); } } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public com.google.cloud.translate.v3beta1.Translation getTranslations(int index) { if (translationsBuilder_ == null) { return translations_.get(index); } else { return translationsBuilder_.getMessage(index); } } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder setTranslations( int index, com.google.cloud.translate.v3beta1.Translation value) { if (translationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTranslationsIsMutable(); translations_.set(index, value); onChanged(); } else { translationsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder setTranslations( int index, com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); translations_.set(index, builderForValue.build()); onChanged(); } else { translationsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder addTranslations(com.google.cloud.translate.v3beta1.Translation value) { if (translationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTranslationsIsMutable(); translations_.add(value); onChanged(); } else { translationsBuilder_.addMessage(value); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder addTranslations( int index, com.google.cloud.translate.v3beta1.Translation value) { if (translationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTranslationsIsMutable(); translations_.add(index, value); onChanged(); } else { translationsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder addTranslations( com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); translations_.add(builderForValue.build()); onChanged(); } else { translationsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder addTranslations( int index, com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); translations_.add(index, builderForValue.build()); onChanged(); } else { translationsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder addAllTranslations( java.lang.Iterable values) { if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, translations_); onChanged(); } else { translationsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder clearTranslations() { if (translationsBuilder_ == null) { translations_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { translationsBuilder_.clear(); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public Builder removeTranslations(int index) { if (translationsBuilder_ == null) { ensureTranslationsIsMutable(); translations_.remove(index); onChanged(); } else { translationsBuilder_.remove(index); } return this; } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public com.google.cloud.translate.v3beta1.Translation.Builder getTranslationsBuilder( int index) { return getTranslationsFieldBuilder().getBuilder(index); } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getTranslationsOrBuilder( int index) { if (translationsBuilder_ == null) { return translations_.get(index); } else { return translationsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public java.util.List getTranslationsOrBuilderList() { if (translationsBuilder_ != null) { return translationsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(translations_); } } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public com.google.cloud.translate.v3beta1.Translation.Builder addTranslationsBuilder() { return getTranslationsFieldBuilder() .addBuilder(com.google.cloud.translate.v3beta1.Translation.getDefaultInstance()); } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public com.google.cloud.translate.v3beta1.Translation.Builder addTranslationsBuilder( int index) { return getTranslationsFieldBuilder() .addBuilder(index, com.google.cloud.translate.v3beta1.Translation.getDefaultInstance()); } /** * * *
     * Text translation responses with no glossary applied.
     * This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation translations = 1; */ public java.util.List getTranslationsBuilderList() { return getTranslationsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder> getTranslationsFieldBuilder() { if (translationsBuilder_ == null) { translationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder>( translations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); translations_ = null; } return translationsBuilder_; } private java.util.List glossaryTranslations_ = java.util.Collections.emptyList(); private void ensureGlossaryTranslationsIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { glossaryTranslations_ = new java.util.ArrayList( glossaryTranslations_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder> glossaryTranslationsBuilder_; /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public java.util.List getGlossaryTranslationsList() { if (glossaryTranslationsBuilder_ == null) { return java.util.Collections.unmodifiableList(glossaryTranslations_); } else { return glossaryTranslationsBuilder_.getMessageList(); } } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public int getGlossaryTranslationsCount() { if (glossaryTranslationsBuilder_ == null) { return glossaryTranslations_.size(); } else { return glossaryTranslationsBuilder_.getCount(); } } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public com.google.cloud.translate.v3beta1.Translation getGlossaryTranslations(int index) { if (glossaryTranslationsBuilder_ == null) { return glossaryTranslations_.get(index); } else { return glossaryTranslationsBuilder_.getMessage(index); } } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder setGlossaryTranslations( int index, com.google.cloud.translate.v3beta1.Translation value) { if (glossaryTranslationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.set(index, value); onChanged(); } else { glossaryTranslationsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder setGlossaryTranslations( int index, com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.set(index, builderForValue.build()); onChanged(); } else { glossaryTranslationsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder addGlossaryTranslations(com.google.cloud.translate.v3beta1.Translation value) { if (glossaryTranslationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.add(value); onChanged(); } else { glossaryTranslationsBuilder_.addMessage(value); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder addGlossaryTranslations( int index, com.google.cloud.translate.v3beta1.Translation value) { if (glossaryTranslationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.add(index, value); onChanged(); } else { glossaryTranslationsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder addGlossaryTranslations( com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.add(builderForValue.build()); onChanged(); } else { glossaryTranslationsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder addGlossaryTranslations( int index, com.google.cloud.translate.v3beta1.Translation.Builder builderForValue) { if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.add(index, builderForValue.build()); onChanged(); } else { glossaryTranslationsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder addAllGlossaryTranslations( java.lang.Iterable values) { if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, glossaryTranslations_); onChanged(); } else { glossaryTranslationsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder clearGlossaryTranslations() { if (glossaryTranslationsBuilder_ == null) { glossaryTranslations_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { glossaryTranslationsBuilder_.clear(); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public Builder removeGlossaryTranslations(int index) { if (glossaryTranslationsBuilder_ == null) { ensureGlossaryTranslationsIsMutable(); glossaryTranslations_.remove(index); onChanged(); } else { glossaryTranslationsBuilder_.remove(index); } return this; } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public com.google.cloud.translate.v3beta1.Translation.Builder getGlossaryTranslationsBuilder( int index) { return getGlossaryTranslationsFieldBuilder().getBuilder(index); } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getGlossaryTranslationsOrBuilder( int index) { if (glossaryTranslationsBuilder_ == null) { return glossaryTranslations_.get(index); } else { return glossaryTranslationsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public java.util.List getGlossaryTranslationsOrBuilderList() { if (glossaryTranslationsBuilder_ != null) { return glossaryTranslationsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(glossaryTranslations_); } } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public com.google.cloud.translate.v3beta1.Translation.Builder addGlossaryTranslationsBuilder() { return getGlossaryTranslationsFieldBuilder() .addBuilder(com.google.cloud.translate.v3beta1.Translation.getDefaultInstance()); } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public com.google.cloud.translate.v3beta1.Translation.Builder addGlossaryTranslationsBuilder( int index) { return getGlossaryTranslationsFieldBuilder() .addBuilder(index, com.google.cloud.translate.v3beta1.Translation.getDefaultInstance()); } /** * * *
     * Text translation responses if a glossary is provided in the request.
     * This can be the same as
     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
     * if no terms apply. This field has the same length as
     * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
     * 
* * repeated .google.cloud.translation.v3beta1.Translation glossary_translations = 3; * */ public java.util.List getGlossaryTranslationsBuilderList() { return getGlossaryTranslationsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder> getGlossaryTranslationsFieldBuilder() { if (glossaryTranslationsBuilder_ == null) { glossaryTranslationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.translate.v3beta1.Translation, com.google.cloud.translate.v3beta1.Translation.Builder, com.google.cloud.translate.v3beta1.TranslationOrBuilder>( glossaryTranslations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); glossaryTranslations_ = null; } return glossaryTranslationsBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.translation.v3beta1.TranslateTextResponse) } // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextResponse) private static final com.google.cloud.translate.v3beta1.TranslateTextResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.TranslateTextResponse(); } public static com.google.cloud.translate.v3beta1.TranslateTextResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public TranslateTextResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy