Dela via


FieldValue Class

  • java.lang.Object
    • com.azure.ai.formrecognizer.models.FieldValue

public final class FieldValue

Represents the strongly-typed value of a field recognized from the input document and provides methods for converting it to the appropriate type.

Constructor Summary

Constructor Description
FieldValue(Object value, FieldValueType valueType)

Constructs a FieldValue object

Method Summary

Modifier and Type Method and Description
String asCountryRegion()

Gets the value of the field as a country or region in the world.

LocalDate asDate()

Gets the value of the field as a LocalDate.

Float asFloat()

Gets the value of the field as a Float.

List<FormField> asList()

Gets the value of the field as a List.

Long asLong()

Gets the value of the field as a Long.

Map<String,FormField> asMap()

Gets the value of the field as a Map.

String asPhoneNumber()

Gets the value of the field as a phone number.

SelectionMarkState asSelectionMarkState()

Gets the value of the field as a selection mark state.

String asString()

Gets the value of the field as a String.

LocalTime asTime()

Gets the value of the field as a LocalTime.

FieldValueType getValueType()

Gets the type of the value of the field.

Methods inherited from java.lang.Object

Constructor Details

FieldValue

public FieldValue(Object value, FieldValueType valueType)

Constructs a FieldValue object

Parameters:

value - The actual value of the field.
valueType - The type of the field.

Method Details

asCountryRegion

public String asCountryRegion()

Gets the value of the field as a country or region in the world.

Returns:

the value of the field as COUNTRY_REGION.

asDate

public LocalDate asDate()

Gets the value of the field as a LocalDate.

Returns:

the value of the field as a LocalDate.

asFloat

public Float asFloat()

Gets the value of the field as a Float.

Returns:

the value of the field as a Float.

asList

public List asList()

Gets the value of the field as a List.

Returns:

the value of the field as an unmodifiable List.

asLong

public Long asLong()

Gets the value of the field as a Long.

Returns:

the value of the field as a Long.

asMap

public Map asMap()

Gets the value of the field as a Map.

Returns:

the value of the field as an unmodifiable Map.

asPhoneNumber

public String asPhoneNumber()

Gets the value of the field as a phone number.

Returns:

the value of the field as a phone number.

asSelectionMarkState

public SelectionMarkState asSelectionMarkState()

Gets the value of the field as a selection mark state.

Returns:

the value of the field as an unmodifiable selection mark state.

asString

public String asString()

Gets the value of the field as a String.

Returns:

the value of the field as a String.

asTime

public LocalTime asTime()

Gets the value of the field as a LocalTime.

Returns:

the value of the field as a LocalTime.

getValueType

public FieldValueType getValueType()

Gets the type of the value of the field.

Returns:

the FieldValueType of the field.

Applies to