Class DetectLanguageRequest.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
com.google.cloud.translate.v3.DetectLanguageRequest.Builder
All Implemented Interfaces:
DetectLanguageRequestOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
DetectLanguageRequest

public static final class DetectLanguageRequest.Builder extends com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder> implements DetectLanguageRequestOrBuilder
 The request message for language detection.
 
Protobuf type google.cloud.translation.v3.DetectLanguageRequest
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • getDefaultInstanceForType

      public DetectLanguageRequest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public DetectLanguageRequest build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public DetectLanguageRequest buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public DetectLanguageRequest.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DetectLanguageRequest.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<DetectLanguageRequest.Builder>
    • mergeFrom

      public DetectLanguageRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DetectLanguageRequest.Builder>
      Throws:
      IOException
    • getSourceCase

      public DetectLanguageRequest.SourceCase getSourceCase()
      Specified by:
      getSourceCase in interface DetectLanguageRequestOrBuilder
    • clearSource

      public DetectLanguageRequest.Builder clearSource()
    • getParent

      public String getParent()
       Required. Project or location to make a call. Must refer to a caller's
       project.
      
       Format: `projects/{project-number-or-id}/locations/{location-id}` or
       `projects/{project-number-or-id}`.
      
       For global calls, use `projects/{project-number-or-id}/locations/global` or
       `projects/{project-number-or-id}`.
      
       Only models within the same region (has same location-id) can be used.
       Otherwise an INVALID_ARGUMENT (400) error is returned.
       
      string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getParent in interface DetectLanguageRequestOrBuilder
      Returns:
      The parent.
    • getParentBytes

      public com.google.protobuf.ByteString getParentBytes()
       Required. Project or location to make a call. Must refer to a caller's
       project.
      
       Format: `projects/{project-number-or-id}/locations/{location-id}` or
       `projects/{project-number-or-id}`.
      
       For global calls, use `projects/{project-number-or-id}/locations/global` or
       `projects/{project-number-or-id}`.
      
       Only models within the same region (has same location-id) can be used.
       Otherwise an INVALID_ARGUMENT (400) error is returned.
       
      string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getParentBytes in interface DetectLanguageRequestOrBuilder
      Returns:
      The bytes for parent.
    • setParent

      public DetectLanguageRequest.Builder setParent(String value)
       Required. Project or location to make a call. Must refer to a caller's
       project.
      
       Format: `projects/{project-number-or-id}/locations/{location-id}` or
       `projects/{project-number-or-id}`.
      
       For global calls, use `projects/{project-number-or-id}/locations/global` or
       `projects/{project-number-or-id}`.
      
       Only models within the same region (has same location-id) can be used.
       Otherwise an INVALID_ARGUMENT (400) error is returned.
       
      string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The parent to set.
      Returns:
      This builder for chaining.
    • clearParent

      public DetectLanguageRequest.Builder clearParent()
       Required. Project or location to make a call. Must refer to a caller's
       project.
      
       Format: `projects/{project-number-or-id}/locations/{location-id}` or
       `projects/{project-number-or-id}`.
      
       For global calls, use `projects/{project-number-or-id}/locations/global` or
       `projects/{project-number-or-id}`.
      
       Only models within the same region (has same location-id) can be used.
       Otherwise an INVALID_ARGUMENT (400) error is returned.
       
      string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Returns:
      This builder for chaining.
    • setParentBytes

      public DetectLanguageRequest.Builder setParentBytes(com.google.protobuf.ByteString value)
       Required. Project or location to make a call. Must refer to a caller's
       project.
      
       Format: `projects/{project-number-or-id}/locations/{location-id}` or
       `projects/{project-number-or-id}`.
      
       For global calls, use `projects/{project-number-or-id}/locations/global` or
       `projects/{project-number-or-id}`.
      
       Only models within the same region (has same location-id) can be used.
       Otherwise an INVALID_ARGUMENT (400) error is returned.
       
      string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The bytes for parent to set.
      Returns:
      This builder for chaining.
    • getModel

      public String getModel()
       Optional. The language detection model to be used.
      
       Format:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      
       Only one language detection model is currently supported:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      
       If not specified, the default model is used.
       
      string model = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getModel in interface DetectLanguageRequestOrBuilder
      Returns:
      The model.
    • getModelBytes

      public com.google.protobuf.ByteString getModelBytes()
       Optional. The language detection model to be used.
      
       Format:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      
       Only one language detection model is currently supported:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      
       If not specified, the default model is used.
       
      string model = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getModelBytes in interface DetectLanguageRequestOrBuilder
      Returns:
      The bytes for model.
    • setModel

      public DetectLanguageRequest.Builder setModel(String value)
       Optional. The language detection model to be used.
      
       Format:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      
       Only one language detection model is currently supported:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      
       If not specified, the default model is used.
       
      string model = 4 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The model to set.
      Returns:
      This builder for chaining.
    • clearModel

      public DetectLanguageRequest.Builder clearModel()
       Optional. The language detection model to be used.
      
       Format:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      
       Only one language detection model is currently supported:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      
       If not specified, the default model is used.
       
      string model = 4 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setModelBytes

      public DetectLanguageRequest.Builder setModelBytes(com.google.protobuf.ByteString value)
       Optional. The language detection model to be used.
      
       Format:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      
       Only one language detection model is currently supported:
       `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      
       If not specified, the default model is used.
       
      string model = 4 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for model to set.
      Returns:
      This builder for chaining.
    • hasContent

      public boolean hasContent()
       The content of the input stored as a string.
       
      string content = 1;
      Specified by:
      hasContent in interface DetectLanguageRequestOrBuilder
      Returns:
      Whether the content field is set.
    • getContent

      public String getContent()
       The content of the input stored as a string.
       
      string content = 1;
      Specified by:
      getContent in interface DetectLanguageRequestOrBuilder
      Returns:
      The content.
    • getContentBytes

      public com.google.protobuf.ByteString getContentBytes()
       The content of the input stored as a string.
       
      string content = 1;
      Specified by:
      getContentBytes in interface DetectLanguageRequestOrBuilder
      Returns:
      The bytes for content.
    • setContent

      public DetectLanguageRequest.Builder setContent(String value)
       The content of the input stored as a string.
       
      string content = 1;
      Parameters:
      value - The content to set.
      Returns:
      This builder for chaining.
    • clearContent

      public DetectLanguageRequest.Builder clearContent()
       The content of the input stored as a string.
       
      string content = 1;
      Returns:
      This builder for chaining.
    • setContentBytes

      public DetectLanguageRequest.Builder setContentBytes(com.google.protobuf.ByteString value)
       The content of the input stored as a string.
       
      string content = 1;
      Parameters:
      value - The bytes for content to set.
      Returns:
      This builder for chaining.
    • getMimeType

      public String getMimeType()
       Optional. The format of the source text, for example, "text/html",
       "text/plain". If left blank, the MIME type defaults to "text/html".
       
      string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getMimeType in interface DetectLanguageRequestOrBuilder
      Returns:
      The mimeType.
    • getMimeTypeBytes

      public com.google.protobuf.ByteString getMimeTypeBytes()
       Optional. The format of the source text, for example, "text/html",
       "text/plain". If left blank, the MIME type defaults to "text/html".
       
      string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getMimeTypeBytes in interface DetectLanguageRequestOrBuilder
      Returns:
      The bytes for mimeType.
    • setMimeType

      public DetectLanguageRequest.Builder setMimeType(String value)
       Optional. The format of the source text, for example, "text/html",
       "text/plain". If left blank, the MIME type defaults to "text/html".
       
      string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The mimeType to set.
      Returns:
      This builder for chaining.
    • clearMimeType

      public DetectLanguageRequest.Builder clearMimeType()
       Optional. The format of the source text, for example, "text/html",
       "text/plain". If left blank, the MIME type defaults to "text/html".
       
      string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setMimeTypeBytes

      public DetectLanguageRequest.Builder setMimeTypeBytes(com.google.protobuf.ByteString value)
       Optional. The format of the source text, for example, "text/html",
       "text/plain". If left blank, the MIME type defaults to "text/html".
       
      string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for mimeType to set.
      Returns:
      This builder for chaining.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: DetectLanguageRequestOrBuilder
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsCount in interface DetectLanguageRequestOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsLabels in interface DetectLanguageRequestOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface DetectLanguageRequestOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsMap in interface DetectLanguageRequestOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsOrDefault in interface DetectLanguageRequestOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsOrThrow in interface DetectLanguageRequestOrBuilder
    • clearLabels

      public DetectLanguageRequest.Builder clearLabels()
    • removeLabels

      public DetectLanguageRequest.Builder removeLabels(String key)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
    • getMutableLabels

      @Deprecated public Map<String,String> getMutableLabels()
      Deprecated.
      Use alternate mutation accessors instead.
    • putLabels

      public DetectLanguageRequest.Builder putLabels(String key, String value)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
    • putAllLabels

      public DetectLanguageRequest.Builder putAllLabels(Map<String,String> values)
       Optional. The labels with user-defined metadata for the request.
      
       Label keys and values can be no longer than 63 characters
       (Unicode codepoints), can only contain lowercase letters, numeric
       characters, underscores and dashes. International characters are allowed.
       Label values are optional. Label keys must start with a letter.
      
       See https://cloud.google.com/translate/docs/advanced/labels for more
       information.
       
      map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];