Class Document.Builder

  • All Implemented Interfaces:
    DocumentOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    Document

    public static final class Document.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
    implements DocumentOrBuilder
     Represents the input to API methods.
     
    Protobuf type google.cloud.language.v2.Document
    • Method Detail

      • getDescriptor

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

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

        public Document.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.GeneratedMessageV3.Builder<Document.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.GeneratedMessageV3.Builder<Document.Builder>
      • getDefaultInstanceForType

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

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

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

        public Document.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • setField

        public Document.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                         Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • clearField

        public Document.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • clearOneof

        public Document.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • setRepeatedField

        public Document.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 int index,
                                                 Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • addRepeatedField

        public Document.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • mergeFrom

        public Document.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<Document.Builder>
      • isInitialized

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

        public Document.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<Document.Builder>
        Throws:
        IOException
      • getTypeValue

        public int getTypeValue()
         Required. If the type is not set or is `TYPE_UNSPECIFIED`,
         returns an `INVALID_ARGUMENT` error.
         
        .google.cloud.language.v2.Document.Type type = 1;
        Specified by:
        getTypeValue in interface DocumentOrBuilder
        Returns:
        The enum numeric value on the wire for type.
      • setTypeValue

        public Document.Builder setTypeValue​(int value)
         Required. If the type is not set or is `TYPE_UNSPECIFIED`,
         returns an `INVALID_ARGUMENT` error.
         
        .google.cloud.language.v2.Document.Type type = 1;
        Parameters:
        value - The enum numeric value on the wire for type to set.
        Returns:
        This builder for chaining.
      • getType

        public Document.Type getType()
         Required. If the type is not set or is `TYPE_UNSPECIFIED`,
         returns an `INVALID_ARGUMENT` error.
         
        .google.cloud.language.v2.Document.Type type = 1;
        Specified by:
        getType in interface DocumentOrBuilder
        Returns:
        The type.
      • setType

        public Document.Builder setType​(Document.Type value)
         Required. If the type is not set or is `TYPE_UNSPECIFIED`,
         returns an `INVALID_ARGUMENT` error.
         
        .google.cloud.language.v2.Document.Type type = 1;
        Parameters:
        value - The type to set.
        Returns:
        This builder for chaining.
      • clearType

        public Document.Builder clearType()
         Required. If the type is not set or is `TYPE_UNSPECIFIED`,
         returns an `INVALID_ARGUMENT` error.
         
        .google.cloud.language.v2.Document.Type type = 1;
        Returns:
        This builder for chaining.
      • hasContent

        public boolean hasContent()
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Specified by:
        hasContent in interface DocumentOrBuilder
        Returns:
        Whether the content field is set.
      • getContent

        public String getContent()
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Specified by:
        getContent in interface DocumentOrBuilder
        Returns:
        The content.
      • getContentBytes

        public com.google.protobuf.ByteString getContentBytes()
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Specified by:
        getContentBytes in interface DocumentOrBuilder
        Returns:
        The bytes for content.
      • setContent

        public Document.Builder setContent​(String value)
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Parameters:
        value - The content to set.
        Returns:
        This builder for chaining.
      • clearContent

        public Document.Builder clearContent()
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Returns:
        This builder for chaining.
      • setContentBytes

        public Document.Builder setContentBytes​(com.google.protobuf.ByteString value)
         The content of the input in string format.
         Cloud audit logging exempt since it is based on user data.
         
        string content = 2;
        Parameters:
        value - The bytes for content to set.
        Returns:
        This builder for chaining.
      • hasGcsContentUri

        public boolean hasGcsContentUri()
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Specified by:
        hasGcsContentUri in interface DocumentOrBuilder
        Returns:
        Whether the gcsContentUri field is set.
      • getGcsContentUri

        public String getGcsContentUri()
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Specified by:
        getGcsContentUri in interface DocumentOrBuilder
        Returns:
        The gcsContentUri.
      • getGcsContentUriBytes

        public com.google.protobuf.ByteString getGcsContentUriBytes()
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Specified by:
        getGcsContentUriBytes in interface DocumentOrBuilder
        Returns:
        The bytes for gcsContentUri.
      • setGcsContentUri

        public Document.Builder setGcsContentUri​(String value)
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Parameters:
        value - The gcsContentUri to set.
        Returns:
        This builder for chaining.
      • clearGcsContentUri

        public Document.Builder clearGcsContentUri()
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Returns:
        This builder for chaining.
      • setGcsContentUriBytes

        public Document.Builder setGcsContentUriBytes​(com.google.protobuf.ByteString value)
         The Google Cloud Storage URI where the file content is located.
         This URI must be of the form: gs://bucket_name/object_name. For more
         details, see https://cloud.google.com/storage/docs/reference-uris.
         NOTE: Cloud Storage object versioning is not supported.
         
        string gcs_content_uri = 3;
        Parameters:
        value - The bytes for gcsContentUri to set.
        Returns:
        This builder for chaining.
      • getLanguageCode

        public String getLanguageCode()
         Optional. The language of the document (if not specified, the language is
         automatically detected). Both ISO and BCP-47 language codes are
         accepted.<br>
         [Language
         Support](https://cloud.google.com/natural-language/docs/languages) lists
         currently supported languages for each API method. If the language (either
         specified by the caller or automatically detected) is not supported by the
         called API method, an `INVALID_ARGUMENT` error is returned.
         
        string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCode in interface DocumentOrBuilder
        Returns:
        The languageCode.
      • getLanguageCodeBytes

        public com.google.protobuf.ByteString getLanguageCodeBytes()
         Optional. The language of the document (if not specified, the language is
         automatically detected). Both ISO and BCP-47 language codes are
         accepted.<br>
         [Language
         Support](https://cloud.google.com/natural-language/docs/languages) lists
         currently supported languages for each API method. If the language (either
         specified by the caller or automatically detected) is not supported by the
         called API method, an `INVALID_ARGUMENT` error is returned.
         
        string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCodeBytes in interface DocumentOrBuilder
        Returns:
        The bytes for languageCode.
      • setLanguageCode

        public Document.Builder setLanguageCode​(String value)
         Optional. The language of the document (if not specified, the language is
         automatically detected). Both ISO and BCP-47 language codes are
         accepted.<br>
         [Language
         Support](https://cloud.google.com/natural-language/docs/languages) lists
         currently supported languages for each API method. If the language (either
         specified by the caller or automatically detected) is not supported by the
         called API method, an `INVALID_ARGUMENT` error is returned.
         
        string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
        Parameters:
        value - The languageCode to set.
        Returns:
        This builder for chaining.
      • clearLanguageCode

        public Document.Builder clearLanguageCode()
         Optional. The language of the document (if not specified, the language is
         automatically detected). Both ISO and BCP-47 language codes are
         accepted.<br>
         [Language
         Support](https://cloud.google.com/natural-language/docs/languages) lists
         currently supported languages for each API method. If the language (either
         specified by the caller or automatically detected) is not supported by the
         called API method, an `INVALID_ARGUMENT` error is returned.
         
        string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
        Returns:
        This builder for chaining.
      • setLanguageCodeBytes

        public Document.Builder setLanguageCodeBytes​(com.google.protobuf.ByteString value)
         Optional. The language of the document (if not specified, the language is
         automatically detected). Both ISO and BCP-47 language codes are
         accepted.<br>
         [Language
         Support](https://cloud.google.com/natural-language/docs/languages) lists
         currently supported languages for each API method. If the language (either
         specified by the caller or automatically detected) is not supported by the
         called API method, an `INVALID_ARGUMENT` error is returned.
         
        string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
        Parameters:
        value - The bytes for languageCode to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Document.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
      • mergeUnknownFields

        public final Document.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>