ContentField Class
- java.
lang. Object - com.
azure. ai. contentunderstanding. models. ContentField
- com.
Implements
public class ContentField
implements JsonSerializable<ContentField>
Field extracted from the content.
Constructor Summary
| Modifier | Constructor | Description |
|---|---|---|
| protected | ContentField() |
Creates an instance of Content |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Content |
fromJson(JsonReader jsonReader)
Reads an instance of Content |
| Double |
getConfidence()
Get the confidence property: Confidence of predicting the field value. |
|
List<Content |
getSources()
Parses the encoded source string into typed content sources. |
|
List<Content |
getSpans()
Get the spans property: Span(s) associated with the field value in the markdown content. |
|
Content |
getType()
Get the type property: Semantic data type of the field value. |
| Object |
getValue()
Gets the value of the field, regardless of its type. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
ContentField
protected ContentField()
Creates an instance of ContentField class.
Method Details
fromJson
public static ContentField fromJson(JsonReader jsonReader)
Reads an instance of ContentField from the JsonReader.
Parameters:
Returns:
Throws:
getConfidence
public Double getConfidence()
Get the confidence property: Confidence of predicting the field value.
Returns:
getSources
public List<ContentSource> getSources()
Parses the encoded source string into typed content sources. The returned list contains DocumentSource or AudioVisualSource instances depending on the wire format. Returns null if the source string is null or empty.
Returns:
getSpans
public List<ContentSpan> getSpans()
Get the spans property: Span(s) associated with the field value in the markdown content.
Returns:
getType
public ContentFieldType getType()
Get the type property: Semantic data type of the field value.
Returns:
getValue
public Object getValue()
Gets the value of the field, regardless of its type. This base method returns Object. Each subclass also overrides this method with a covariant return type for compile-time type safety: - getValue() returns String - getValue() returns Double - getValue() returns Long - getValue() returns LocalDate - getValue() returns String - getValue() returns Boolean - getValue() returns Map - getValue() returns List - getValue() returns BinaryData When you have a reference to the specific subclass, use its typed getValue() to avoid casting. When you only have a ContentField reference, this method returns the value as Object.
Returns: