Package com.google.cloud.language.v1
Class Entity.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
com.google.cloud.language.v1.Entity.Builder
- All Implemented Interfaces:
EntityOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- Entity
public static final class Entity.Builder
extends com.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
implements EntityOrBuilder
Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.Protobuf type
google.cloud.language.v1.Entity-
Method Summary
Modifier and TypeMethodDescriptionaddAllMentions(Iterable<? extends EntityMention> values) The mentions of this entity in the input document.addMentions(int index, EntityMention value) The mentions of this entity in the input document.addMentions(int index, EntityMention.Builder builderForValue) The mentions of this entity in the input document.addMentions(EntityMention value) The mentions of this entity in the input document.addMentions(EntityMention.Builder builderForValue) The mentions of this entity in the input document.The mentions of this entity in the input document.addMentionsBuilder(int index) The mentions of this entity in the input document.build()clear()The mentions of this entity in the input document.The representative name for the entity.The salience score associated with the entity in the [0, 1.0] range.For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.The entity type.booleancontainsMetadata(String key) Metadata associated with the entity.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetMentions(int index) The mentions of this entity in the input document.getMentionsBuilder(int index) The mentions of this entity in the input document.The mentions of this entity in the input document.intThe mentions of this entity in the input document.The mentions of this entity in the input document.getMentionsOrBuilder(int index) The mentions of this entity in the input document.List<? extends EntityMentionOrBuilder>The mentions of this entity in the input document.Deprecated.intMetadata associated with the entity.Metadata associated with the entity.getMetadataOrDefault(String key, String defaultValue) Metadata associated with the entity.getMetadataOrThrow(String key) Metadata associated with the entity.Deprecated.getName()The representative name for the entity.com.google.protobuf.ByteStringThe representative name for the entity.floatThe salience score associated with the entity in the [0, 1.0] range.For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.getType()The entity type.intThe entity type.booleanFor calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) protected com.google.protobuf.MapFieldReflectionAccessorinternalGetMutableMapFieldReflection(int number) final booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeSentiment(Sentiment value) For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.putAllMetadata(Map<String, String> values) Metadata associated with the entity.putMetadata(String key, String value) Metadata associated with the entity.removeMentions(int index) The mentions of this entity in the input document.removeMetadata(String key) Metadata associated with the entity.setMentions(int index, EntityMention value) The mentions of this entity in the input document.setMentions(int index, EntityMention.Builder builderForValue) The mentions of this entity in the input document.The representative name for the entity.setNameBytes(com.google.protobuf.ByteString value) The representative name for the entity.setSalience(float value) The salience score associated with the entity in the [0, 1.0] range.setSentiment(Sentiment value) For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.setSentiment(Sentiment.Builder builderForValue) For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.setType(Entity.Type value) The entity type.setTypeValue(int value) The entity type.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
-
internalGetMutableMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) - Overrides:
internalGetMutableMapFieldReflectionin classcom.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<Entity.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.GeneratedMessage.Builder<Entity.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Entity.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<Entity.Builder>
-
mergeFrom
public Entity.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<Entity.Builder>- Throws:
IOException
-
getName
The representative name for the entity.
string name = 1;- Specified by:
getNamein interfaceEntityOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The representative name for the entity.
string name = 1;- Specified by:
getNameBytesin interfaceEntityOrBuilder- Returns:
- The bytes for name.
-
setName
The representative name for the entity.
string name = 1;- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
The representative name for the entity.
string name = 1;- Returns:
- This builder for chaining.
-
setNameBytes
The representative name for the entity.
string name = 1;- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
getTypeValue
public int getTypeValue()The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Specified by:
getTypeValuein interfaceEntityOrBuilder- Returns:
- The enum numeric value on the wire for type.
-
setTypeValue
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Parameters:
value- The enum numeric value on the wire for type to set.- Returns:
- This builder for chaining.
-
getType
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Specified by:
getTypein interfaceEntityOrBuilder- Returns:
- The type.
-
setType
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Parameters:
value- The type to set.- Returns:
- This builder for chaining.
-
clearType
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Returns:
- This builder for chaining.
-
getMetadataCount
public int getMetadataCount()Description copied from interface:EntityOrBuilderMetadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;- Specified by:
getMetadataCountin interfaceEntityOrBuilder
-
containsMetadata
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;- Specified by:
containsMetadatain interfaceEntityOrBuilder
-
getMetadata
Deprecated.UsegetMetadataMap()instead.- Specified by:
getMetadatain interfaceEntityOrBuilder
-
getMetadataMap
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;- Specified by:
getMetadataMapin interfaceEntityOrBuilder
-
getMetadataOrDefault
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;- Specified by:
getMetadataOrDefaultin interfaceEntityOrBuilder
-
getMetadataOrThrow
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;- Specified by:
getMetadataOrThrowin interfaceEntityOrBuilder
-
clearMetadata
-
removeMetadata
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3; -
getMutableMetadata
Deprecated.Use alternate mutation accessors instead. -
putMetadata
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3; -
putAllMetadata
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3; -
getSalience
public float getSalience()The salience score associated with the entity in the [0, 1.0] range. The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
float salience = 4;- Specified by:
getSaliencein interfaceEntityOrBuilder- Returns:
- The salience.
-
setSalience
The salience score associated with the entity in the [0, 1.0] range. The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
float salience = 4;- Parameters:
value- The salience to set.- Returns:
- This builder for chaining.
-
clearSalience
The salience score associated with the entity in the [0, 1.0] range. The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
float salience = 4;- Returns:
- This builder for chaining.
-
getMentionsList
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsListin interfaceEntityOrBuilder
-
getMentionsCount
public int getMentionsCount()The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsCountin interfaceEntityOrBuilder
-
getMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsin interfaceEntityOrBuilder
-
setMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
setMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addAllMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
clearMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
removeMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
getMentionsBuilder
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
getMentionsOrBuilder
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsOrBuilderin interfaceEntityOrBuilder
-
getMentionsOrBuilderList
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsOrBuilderListin interfaceEntityOrBuilder
-
addMentionsBuilder
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
addMentionsBuilder
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
getMentionsBuilderList
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5; -
hasSentiment
public boolean hasSentiment()For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;- Specified by:
hasSentimentin interfaceEntityOrBuilder- Returns:
- Whether the sentiment field is set.
-
getSentiment
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;- Specified by:
getSentimentin interfaceEntityOrBuilder- Returns:
- The sentiment.
-
setSentiment
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6; -
setSentiment
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6; -
mergeSentiment
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6; -
clearSentiment
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6; -
getSentimentBuilder
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6; -
getSentimentOrBuilder
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;- Specified by:
getSentimentOrBuilderin interfaceEntityOrBuilder
-