Class Document.Builder (2.31.0)

public static final class Document.Builder extends GeneratedMessageV3.Builder<Document.Builder> implements DocumentOrBuilder

Represents the input to API methods.

Protobuf type google.cloud.language.v1.Document

Implements

DocumentOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Document.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Document.Builder
Overrides

build()

public Document build()
Returns
TypeDescription
Document

buildPartial()

public Document buildPartial()
Returns
TypeDescription
Document

clear()

public Document.Builder clear()
Returns
TypeDescription
Document.Builder
Overrides

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
TypeDescription
Document.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Document.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Document.Builder
Overrides

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
TypeDescription
Document.Builder

This builder for chaining.

clearLanguage()

public Document.Builder clearLanguage()

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 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 = 4;

Returns
TypeDescription
Document.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Document.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Document.Builder
Overrides

clearSource()

public Document.Builder clearSource()
Returns
TypeDescription
Document.Builder

clearType()

public Document.Builder clearType()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v1.Document.Type type = 1;

Returns
TypeDescription
Document.Builder

This builder for chaining.

clone()

public Document.Builder clone()
Returns
TypeDescription
Document.Builder
Overrides

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;

Returns
TypeDescription
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Returns
TypeDescription
ByteString

The bytes for content.

getDefaultInstanceForType()

public Document getDefaultInstanceForType()
Returns
TypeDescription
Document

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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;

Returns
TypeDescription
String

The gcsContentUri.

getGcsContentUriBytes()

public 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;

Returns
TypeDescription
ByteString

The bytes for gcsContentUri.

getLanguage()

public String getLanguage()

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 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 = 4;

Returns
TypeDescription
String

The language.

getLanguageBytes()

public ByteString getLanguageBytes()

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 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 = 4;

Returns
TypeDescription
ByteString

The bytes for language.

getSourceCase()

public Document.SourceCase getSourceCase()
Returns
TypeDescription
Document.SourceCase

getType()

public Document.Type getType()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v1.Document.Type type = 1;

Returns
TypeDescription
Document.Type

The type.

getTypeValue()

public int getTypeValue()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v1.Document.Type type = 1;

Returns
TypeDescription
int

The enum numeric value on the wire for type.

hasContent()