Class Label
- java.lang.Object
-
- software.amazon.awssdk.services.rekognition.model.Label
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Label.Builder,Label>
@Generated("software.amazon.awssdk:codegen") public final class Label extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Label.Builder,Label>
Structure containing details about the detected label, including the name, detected instances, parent labels, and level of confidence.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLabel.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LabelAlias>aliases()A list of potential aliases for a given label.static Label.Builderbuilder()List<LabelCategory>categories()A list of the categories associated with a given label.Floatconfidence()Level of confidence.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasAliases()For responses, this returns true if the service returned a value for the Aliases property.booleanhasCategories()For responses, this returns true if the service returned a value for the Categories property.inthashCode()booleanhasInstances()For responses, this returns true if the service returned a value for the Instances property.booleanhasParents()For responses, this returns true if the service returned a value for the Parents property.List<Instance>instances()IfLabelrepresents an object,Instancescontains the bounding boxes for each instance of the detected object.Stringname()The name (label) of the object or scene.List<Parent>parents()The parent labels for a label.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends Label.Builder>serializableBuilderClass()Label.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
name
public final String name()
The name (label) of the object or scene.
- Returns:
- The name (label) of the object or scene.
-
confidence
public final Float confidence()
Level of confidence.
- Returns:
- Level of confidence.
-
hasInstances
public final boolean hasInstances()
For responses, this returns true if the service returned a value for the Instances property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
instances
public final List<Instance> instances()
If
Labelrepresents an object,Instancescontains the bounding boxes for each instance of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, apparel or pets.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
hasInstances()method.- Returns:
- If
Labelrepresents an object,Instancescontains the bounding boxes for each instance of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, apparel or pets.
-
hasParents
public final boolean hasParents()
For responses, this returns true if the service returned a value for the Parents property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
parents
public final List<Parent> parents()
The parent labels for a label. The response includes all ancestor labels.
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
hasParents()method.- Returns:
- The parent labels for a label. The response includes all ancestor labels.
-
hasAliases
public final boolean hasAliases()
For responses, this returns true if the service returned a value for the Aliases property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
aliases
public final List<LabelAlias> aliases()
A list of potential aliases for a given label.
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
hasAliases()method.- Returns:
- A list of potential aliases for a given label.
-
hasCategories
public final boolean hasCategories()
For responses, this returns true if the service returned a value for the Categories property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
categories
public final List<LabelCategory> categories()
A list of the categories associated with a given label.
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
hasCategories()method.- Returns:
- A list of the categories associated with a given label.
-
toBuilder
public Label.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<Label.Builder,Label>
-
builder
public static Label.Builder builder()
-
serializableBuilderClass
public static Class<? extends Label.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-