Package com.mindee.parsing.v2.field
Class ObjectField
- java.lang.Object
-
- com.mindee.parsing.v2.field.BaseField
-
- com.mindee.parsing.v2.field.ObjectField
-
public class ObjectField extends BaseField
Field holding a map of sub-fields.
-
-
Constructor Summary
Constructors Constructor Description ObjectField()ObjectField(InferenceFields fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)InferenceFieldsgetFields()Sub-fields keyed by their name.ListFieldgetListField(String fieldKey)Retrieves a list sub-field from thefieldsmap as aListField.LinkedHashMap<String,ListField>getListFields()Retrieves all subfields from thefieldsmap as aLinkedHashMapofListFieldobjects, keyed by their field names.ObjectFieldgetObjectField(String fieldKey)Retrieves an object sub-field from thefieldsmap as aObjectField.LinkedHashMap<String,ObjectField>getObjectFields()Retrieves all subfields from thefieldsmap as aLinkedHashMapofObjectFieldobjects, keyed by their field names.SimpleFieldgetSimpleField(String fieldKey)Retrieves a single sub-field from thefieldsmap as aSimpleField.LinkedHashMap<String,SimpleField>getSimpleFields()Retrieves all sub-fields from thefieldsmap as aLinkedHashMapofSimpleFieldobjects, keyed by their field names.inthashCode()StringtoString()StringtoStringFromList()-
Methods inherited from class com.mindee.parsing.v2.field.BaseField
getConfidence, getLocations, setConfidence, setLocations
-
-
-
-
Constructor Detail
-
ObjectField
public ObjectField(InferenceFields fields)
-
ObjectField
public ObjectField()
-
-
Method Detail
-
getSimpleFields
public LinkedHashMap<String,SimpleField> getSimpleFields() throws IllegalStateException
Retrieves all sub-fields from thefieldsmap as aLinkedHashMapofSimpleFieldobjects, keyed by their field names.- Returns:
- a
LinkedHashMapcontaining the field names as keys and their correspondingSimpleFieldinstances as values - Throws:
IllegalStateException- if any field is not of typeSIMPLE_FIELD
-
getListFields
public LinkedHashMap<String,ListField> getListFields()
Retrieves all subfields from thefieldsmap as aLinkedHashMapofListFieldobjects, keyed by their field names.- Returns:
- a
LinkedHashMapcontaining the field names as keys and their correspondingListFieldinstances as values (only includes fields that are list fields)
-
getObjectFields
public LinkedHashMap<String,ObjectField> getObjectFields()
Retrieves all subfields from thefieldsmap as aLinkedHashMapofObjectFieldobjects, keyed by their field names.- Returns:
- a
LinkedHashMapcontaining the field names as keys and their correspondingObjectFieldobjects as values
-
getSimpleField
public SimpleField getSimpleField(String fieldKey) throws IllegalStateException
Retrieves a single sub-field from thefieldsmap as aSimpleField.- Parameters:
fieldKey- the name/key of the field to retrieve- Returns:
- the corresponding
SimpleField, ornulliffieldsisnullor if no field exists forfieldKey(depending onfields' behavior) - Throws:
IllegalStateException- if the referenced field exists but is not of typeSIMPLE_FIELD
-
getListField
public ListField getListField(String fieldKey)
Retrieves a list sub-field from thefieldsmap as aListField.- Parameters:
fieldKey- the name/key of the field to retrieve- Returns:
- the corresponding
ListField, ornulliffieldsisnullor if no field exists forfieldKey(depending onfields' behavior) - Throws:
IllegalStateException- if the referenced field exists but is not of typeLIST_FIELD
-
getObjectField
public ObjectField getObjectField(String fieldKey)
Retrieves an object sub-field from thefieldsmap as aObjectField.- Parameters:
fieldKey- the name/key of the field to retrieve- Returns:
- the corresponding
ObjectField, ornulliffieldsisnullor if no field exists forfieldKey(depending onfields' behavior) - Throws:
IllegalStateException- if the referenced field exists but is not of typeOBJECT_FIELD
-
toStringFromList
public String toStringFromList()
-
getFields
public InferenceFields getFields()
Sub-fields keyed by their name.
-
-