public final class Entity extends GeneratedMessageV3 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.v1beta2.Entity| Modifier and Type | Class and Description | 
|---|---|
| static class  | Entity.Builder
 Represents a phrase in the text that is a known entity, such as
 a person, an organization, or location. | 
| static class  | Entity.Type
 The type of the entity. | 
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description | 
|---|---|
| static int | MENTIONS_FIELD_NUMBER | 
| static int | METADATA_FIELD_NUMBER | 
| static int | NAME_FIELD_NUMBER | 
| static int | SALIENCE_FIELD_NUMBER | 
| static int | SENTIMENT_FIELD_NUMBER | 
| static int | TYPE_FIELD_NUMBER | 
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description | 
|---|---|
| boolean | containsMetadata(java.lang.String key)
 Metadata associated with the entity. | 
| boolean | equals(java.lang.Object obj) | 
| static Entity | getDefaultInstance() | 
| Entity | getDefaultInstanceForType() | 
| static Descriptors.Descriptor | getDescriptor() | 
| EntityMention | getMentions(int index)
 The mentions of this entity in the input document. | 
| int | getMentionsCount()
 The mentions of this entity in the input document. | 
| java.util.List<EntityMention> | getMentionsList()
 The mentions of this entity in the input document. | 
| EntityMentionOrBuilder | getMentionsOrBuilder(int index)
 The mentions of this entity in the input document. | 
| java.util.List<? extends EntityMentionOrBuilder> | getMentionsOrBuilderList()
 The mentions of this entity in the input document. | 
| java.util.Map<java.lang.String,java.lang.String> | getMetadata()Deprecated.  | 
| int | getMetadataCount()
 Metadata associated with the entity. | 
| java.util.Map<java.lang.String,java.lang.String> | getMetadataMap()
 Metadata associated with the entity. | 
| java.lang.String | getMetadataOrDefault(java.lang.String key,
                    java.lang.String defaultValue)
 Metadata associated with the entity. | 
| java.lang.String | getMetadataOrThrow(java.lang.String key)
 Metadata associated with the entity. | 
| java.lang.String | getName()
 The representative name for the entity. | 
| ByteString | getNameBytes()
 The representative name for the entity. | 
| Parser<Entity> | getParserForType() | 
| float | getSalience()
 The salience score associated with the entity in the [0, 1.0] range. | 
| Sentiment | getSentiment()
 For calls to [AnalyzeEntitySentiment][] or if
 [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
 true, this field will contain the aggregate sentiment expressed for this
 entity in the provided document. | 
| SentimentOrBuilder | getSentimentOrBuilder()
 For calls to [AnalyzeEntitySentiment][] or if
 [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
 true, this field will contain the aggregate sentiment expressed for this
 entity in the provided document. | 
| int | getSerializedSize() | 
| Entity.Type | getType()
 The entity type. | 
| int | getTypeValue()
 The entity type. | 
| UnknownFieldSet | getUnknownFields() | 
| int | hashCode() | 
| boolean | hasSentiment()
 For calls to [AnalyzeEntitySentiment][] or if
 [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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 GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable() | 
| protected MapField | internalGetMapField(int number) | 
| boolean | isInitialized() | 
| static Entity.Builder | newBuilder() | 
| static Entity.Builder | newBuilder(Entity prototype) | 
| Entity.Builder | newBuilderForType() | 
| protected Entity.Builder | newBuilderForType(GeneratedMessageV3.BuilderParent parent) | 
| static Entity | parseDelimitedFrom(java.io.InputStream input) | 
| static Entity | parseDelimitedFrom(java.io.InputStream input,
                  ExtensionRegistryLite extensionRegistry) | 
| static Entity | parseFrom(byte[] data) | 
| static Entity | parseFrom(byte[] data,
         ExtensionRegistryLite extensionRegistry) | 
| static Entity | parseFrom(java.nio.ByteBuffer data) | 
| static Entity | parseFrom(java.nio.ByteBuffer data,
         ExtensionRegistryLite extensionRegistry) | 
| static Entity | parseFrom(ByteString data) | 
| static Entity | parseFrom(ByteString data,
         ExtensionRegistryLite extensionRegistry) | 
| static Entity | parseFrom(CodedInputStream input) | 
| static Entity | parseFrom(CodedInputStream input,
         ExtensionRegistryLite extensionRegistry) | 
| static Entity | parseFrom(java.io.InputStream input) | 
| static Entity | parseFrom(java.io.InputStream input,
         ExtensionRegistryLite extensionRegistry) | 
| static Parser<Entity> | parser() | 
| Entity.Builder | toBuilder() | 
| void | writeTo(CodedOutputStream output) | 
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int NAME_FIELD_NUMBER
public static final int TYPE_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER
public static final int SALIENCE_FIELD_NUMBER
public static final int MENTIONS_FIELD_NUMBER
public static final int SENTIMENT_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField in class GeneratedMessageV3protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3public java.lang.String getName()
The representative name for the entity.
string name = 1;getName in interface EntityOrBuilderpublic ByteString getNameBytes()
The representative name for the entity.
string name = 1;getNameBytes in interface EntityOrBuilderpublic int getTypeValue()
The entity type.
.google.cloud.language.v1beta2.Entity.Type type = 2;getTypeValue in interface EntityOrBuilderpublic Entity.Type getType()
The entity type.
.google.cloud.language.v1beta2.Entity.Type type = 2;getType in interface EntityOrBuilderpublic int getMetadataCount()
EntityOrBuilderMetadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;getMetadataCount in interface EntityOrBuilderpublic boolean containsMetadata(java.lang.String key)
Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;containsMetadata in interface EntityOrBuilder@Deprecated public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadataMap() instead.getMetadata in interface EntityOrBuilderpublic java.util.Map<java.lang.String,java.lang.String> getMetadataMap()
Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;getMetadataMap in interface EntityOrBuilderpublic java.lang.String getMetadataOrDefault(java.lang.String key,
                                             java.lang.String defaultValue)
Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;getMetadataOrDefault in interface EntityOrBuilderpublic java.lang.String getMetadataOrThrow(java.lang.String key)
Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.
map<string, string> metadata = 3;getMetadataOrThrow in interface EntityOrBuilderpublic 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;getSalience in interface EntityOrBuilderpublic java.util.List<EntityMention> getMentionsList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;getMentionsList in interface EntityOrBuilderpublic java.util.List<? extends EntityMentionOrBuilder> getMentionsOrBuilderList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;getMentionsOrBuilderList in interface EntityOrBuilderpublic int getMentionsCount()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;getMentionsCount in interface EntityOrBuilderpublic EntityMention getMentions(int index)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;getMentions in interface EntityOrBuilderpublic EntityMentionOrBuilder getMentionsOrBuilder(int index)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;getMentionsOrBuilder in interface EntityOrBuilderpublic boolean hasSentiment()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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.v1beta2.Sentiment sentiment = 6;hasSentiment in interface EntityOrBuilderpublic Sentiment getSentiment()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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.v1beta2.Sentiment sentiment = 6;getSentiment in interface EntityOrBuilderpublic SentimentOrBuilder getSentimentOrBuilder()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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.v1beta2.Sentiment sentiment = 6;getSentimentOrBuilder in interface EntityOrBuilderpublic final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface Messageequals in class AbstractMessagepublic int hashCode()
hashCode in interface MessagehashCode in class AbstractMessagepublic static Entity parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Entity parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Entity parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Entity parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Entity parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Entity parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Entity parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic Entity.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static Entity.Builder newBuilder()
public static Entity.Builder newBuilder(Entity prototype)
public Entity.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected Entity.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static Entity getDefaultInstance()
public Parser<Entity> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public Entity getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder