Class Document.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
- com.google.cloud.language.v1beta2.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 typegoogle.cloud.language.v1beta2.Document
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Document.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Documentbuild()DocumentbuildPartial()Document.Builderclear()Document.BuilderclearBoilerplateHandling()Indicates how detected boilerplate(e.g.Document.BuilderclearContent()The content of the input in string format.Document.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)Document.BuilderclearGcsContentUri()The Google Cloud Storage URI where the file content is located.Document.BuilderclearLanguage()The language of the document (if not specified, the language is automatically detected).Document.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)Document.BuilderclearReferenceWebUri()The web URI where the document comes from.Document.BuilderclearSource()Document.BuilderclearType()Required.Document.Builderclone()Document.BoilerplateHandlinggetBoilerplateHandling()Indicates how detected boilerplate(e.g.intgetBoilerplateHandlingValue()Indicates how detected boilerplate(e.g.StringgetContent()The content of the input in string format.com.google.protobuf.ByteStringgetContentBytes()The content of the input in string format.DocumentgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()StringgetGcsContentUri()The Google Cloud Storage URI where the file content is located.com.google.protobuf.ByteStringgetGcsContentUriBytes()The Google Cloud Storage URI where the file content is located.StringgetLanguage()The language of the document (if not specified, the language is automatically detected).com.google.protobuf.ByteStringgetLanguageBytes()The language of the document (if not specified, the language is automatically detected).StringgetReferenceWebUri()The web URI where the document comes from.com.google.protobuf.ByteStringgetReferenceWebUriBytes()The web URI where the document comes from.Document.SourceCasegetSourceCase()Document.TypegetType()Required.intgetTypeValue()Required.booleanhasContent()The content of the input in string format.booleanhasGcsContentUri()The Google Cloud Storage URI where the file content is located.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()Document.BuildermergeFrom(Document other)Document.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)Document.BuildermergeFrom(com.google.protobuf.Message other)Document.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)Document.BuildersetBoilerplateHandling(Document.BoilerplateHandling value)Indicates how detected boilerplate(e.g.Document.BuildersetBoilerplateHandlingValue(int value)Indicates how detected boilerplate(e.g.Document.BuildersetContent(String value)The content of the input in string format.Document.BuildersetContentBytes(com.google.protobuf.ByteString value)The content of the input in string format.Document.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Document.BuildersetGcsContentUri(String value)The Google Cloud Storage URI where the file content is located.Document.BuildersetGcsContentUriBytes(com.google.protobuf.ByteString value)The Google Cloud Storage URI where the file content is located.Document.BuildersetLanguage(String value)The language of the document (if not specified, the language is automatically detected).Document.BuildersetLanguageBytes(com.google.protobuf.ByteString value)The language of the document (if not specified, the language is automatically detected).Document.BuildersetReferenceWebUri(String value)The web URI where the document comes from.Document.BuildersetReferenceWebUriBytes(com.google.protobuf.ByteString value)The web URI where the document comes from.Document.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)Document.BuildersetType(Document.Type value)Required.Document.BuildersetTypeValue(int value)Required.Document.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
clear
public Document.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
getDefaultInstanceForType
public Document getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public Document build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Document buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Document.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
setField
public Document.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
clearField
public Document.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
clearOneof
public Document.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
setRepeatedField
public Document.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
addRepeatedField
public Document.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
mergeFrom
public Document.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Document.Builder>
-
mergeFrom
public Document.Builder mergeFrom(Document other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Document.Builder>- Throws:
IOException
-
getSourceCase
public Document.SourceCase getSourceCase()
- Specified by:
getSourceCasein interfaceDocumentOrBuilder
-
clearSource
public Document.Builder clearSource()
-
getTypeValue
public int getTypeValue()
Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
.google.cloud.language.v1beta2.Document.Type type = 1;- Specified by:
getTypeValuein interfaceDocumentOrBuilder- 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.v1beta2.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.v1beta2.Document.Type type = 1;- Specified by:
getTypein interfaceDocumentOrBuilder- 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.v1beta2.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.v1beta2.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:
hasContentin interfaceDocumentOrBuilder- 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:
getContentin interfaceDocumentOrBuilder- 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:
getContentBytesin interfaceDocumentOrBuilder- 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:
hasGcsContentUriin interfaceDocumentOrBuilder- 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:
getGcsContentUriin interfaceDocumentOrBuilder- 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:
getGcsContentUriBytesin interfaceDocumentOrBuilder- 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.
-
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](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 = 4;- Specified by:
getLanguagein interfaceDocumentOrBuilder- Returns:
- The language.
-
getLanguageBytes
public com.google.protobuf.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](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 = 4;- Specified by:
getLanguageBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for language.
-
setLanguage
public Document.Builder setLanguage(String value)
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 = 4;- Parameters:
value- The language to set.- Returns:
- 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](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 = 4;- Returns:
- This builder for chaining.
-
setLanguageBytes
public Document.Builder setLanguageBytes(com.google.protobuf.ByteString value)
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 = 4;- Parameters:
value- The bytes for language to set.- Returns:
- This builder for chaining.
-
getReferenceWebUri
public String getReferenceWebUri()
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
string reference_web_uri = 5;- Specified by:
getReferenceWebUriin interfaceDocumentOrBuilder- Returns:
- The referenceWebUri.
-
getReferenceWebUriBytes
public com.google.protobuf.ByteString getReferenceWebUriBytes()
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
string reference_web_uri = 5;- Specified by:
getReferenceWebUriBytesin interfaceDocumentOrBuilder- Returns:
- The bytes for referenceWebUri.
-
setReferenceWebUri
public Document.Builder setReferenceWebUri(String value)
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
string reference_web_uri = 5;- Parameters:
value- The referenceWebUri to set.- Returns:
- This builder for chaining.
-
clearReferenceWebUri
public Document.Builder clearReferenceWebUri()
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
string reference_web_uri = 5;- Returns:
- This builder for chaining.
-
setReferenceWebUriBytes
public Document.Builder setReferenceWebUriBytes(com.google.protobuf.ByteString value)
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
string reference_web_uri = 5;- Parameters:
value- The bytes for referenceWebUri to set.- Returns:
- This builder for chaining.
-
getBoilerplateHandlingValue
public int getBoilerplateHandlingValue()
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
.google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6;- Specified by:
getBoilerplateHandlingValuein interfaceDocumentOrBuilder- Returns:
- The enum numeric value on the wire for boilerplateHandling.
-
setBoilerplateHandlingValue
public Document.Builder setBoilerplateHandlingValue(int value)
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
.google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6;- Parameters:
value- The enum numeric value on the wire for boilerplateHandling to set.- Returns:
- This builder for chaining.
-
getBoilerplateHandling
public Document.BoilerplateHandling getBoilerplateHandling()
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
.google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6;- Specified by:
getBoilerplateHandlingin interfaceDocumentOrBuilder- Returns:
- The boilerplateHandling.
-
setBoilerplateHandling
public Document.Builder setBoilerplateHandling(Document.BoilerplateHandling value)
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
.google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6;- Parameters:
value- The boilerplateHandling to set.- Returns:
- This builder for chaining.
-
clearBoilerplateHandling
public Document.Builder clearBoilerplateHandling()
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
.google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6;- Returns:
- This builder for chaining.
-
setUnknownFields
public final Document.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
mergeUnknownFields
public final Document.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Document.Builder>
-
-