@Generated(value="software.amazon.awssdk:codegen") public final class Entity extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Entity.Builder,Entity>
Provides information about an entity.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Entity.Builder |
| Modifier and Type | Method and Description |
|---|---|
Integer |
beginOffset()
The zero-based offset from the beginning of the source text to the first character in the entity.
|
List<BlockReference> |
blockReferences()
A reference to each block for this entity.
|
static Entity.Builder |
builder() |
Integer |
endOffset()
The zero-based offset from the beginning of the source text to the last character in the entity.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasBlockReferences()
For responses, this returns true if the service returned a value for the BlockReferences property.
|
int |
hashCode() |
Float |
score()
The level of confidence that Amazon Comprehend has in the accuracy of the detection.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends Entity.Builder> |
serializableBuilderClass() |
String |
text()
The text of the entity.
|
Entity.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
EntityType |
type()
The entity type.
|
String |
typeAsString()
The entity type.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final Float score()
The level of confidence that Amazon Comprehend has in the accuracy of the detection.
public final EntityType type()
The entity type. For entity detection using the built-in model, this field contains one of the standard entity types listed below.
For custom entity detection, this field contains one of the entity types that you specified when you trained your custom model.
If the service returns an enum value that is not available in the current SDK version, type will return
EntityType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
typeAsString().
For custom entity detection, this field contains one of the entity types that you specified when you trained your custom model.
EntityTypepublic final String typeAsString()
The entity type. For entity detection using the built-in model, this field contains one of the standard entity types listed below.
For custom entity detection, this field contains one of the entity types that you specified when you trained your custom model.
If the service returns an enum value that is not available in the current SDK version, type will return
EntityType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
typeAsString().
For custom entity detection, this field contains one of the entity types that you specified when you trained your custom model.
EntityTypepublic final String text()
The text of the entity.
public final Integer beginOffset()
The zero-based offset from the beginning of the source text to the first character in the entity.
This field is empty for non-text input.
This field is empty for non-text input.
public final Integer endOffset()
The zero-based offset from the beginning of the source text to the last character in the entity.
This field is empty for non-text input.
This field is empty for non-text input.
public final boolean hasBlockReferences()
isEmpty() method on the property).
This is useful because the SDK will never return a null collection or map, but you may need to differentiate
between the service returning nothing (or null) and the service returning an empty collection or map. For
requests, this returns true if a value for the property was specified in the request builder, and false if a
value was not specified.public final List<BlockReference> blockReferences()
A reference to each block for this entity. This field is empty for plain-text input.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasBlockReferences() method.
public Entity.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<Entity.Builder,Entity>public static Entity.Builder builder()
public static Class<? extends Entity.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
Copyright © 2023. All rights reserved.