Class GenericDocument
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class GenericDocument implements Parcelable
A generic document. Contains fields and sub-documents.
To get access to convenient field getters for a specific document types, use GenericDocumentLibrary
The usage is the following: val genericDocument: GenericDocument val wrapper = GenericDocumentLibrary.wrapperFromGenericDocument(genericDocument)
The wrapper variable will be the type of the corresponding document, for example DeIdCardFront
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
GenericDocument.Type
Document type
-
Field Summary
Fields Modifier and Type Field Description private final GenericDocument.Type
type
private final List<Field>
fields
private final List<GenericDocument>
children
private final Float
confidence
private final Float
confidenceWeight
private final List<PointF>
quad
private final List<PointF>
quadInRoot
private final Bitmap
crop
-
Constructor Summary
Constructors Constructor Description GenericDocument(GenericDocument.Type type, List<Field> fields, List<GenericDocument> children, Float confidence, Float confidenceWeight, List<PointF> quad, List<PointF> quadInRoot, Bitmap crop)
-
Method Summary
Modifier and Type Method Description final GenericDocument.Type
getType()
document type final List<Field>
getFields()
a list of document fields final List<GenericDocument>
getChildren()
a list of sub-documents final Float
getConfidence()
the average confidence in the accuracy of the document recognition result final Float
getConfidenceWeight()
the weight of the confidence. final List<PointF>
getQuad()
final List<PointF>
getQuadInRoot()
final Bitmap
getCrop()
final Field
fieldByTypeName(String name)
Returns a field given its local or common type name. final List<Field>
fieldsByTypeName(String name)
Returns all fields given a local or common field type name. final GenericDocument
childByDocumentType(String name)
Returns a sub-document given its document type name. final List<GenericDocument>
childrenByDocumentType(String name)
Returns all children given their document type name. -
-
Method Detail
-
getType
final GenericDocument.Type getType()
document type
-
getChildren
final List<GenericDocument> getChildren()
a list of sub-documents
-
getConfidence
final Float getConfidence()
the average confidence in the accuracy of the document recognition result
-
getConfidenceWeight
final Float getConfidenceWeight()
the weight of the confidence. Can be used to calculate the weighted average confidence of two documents.
-
getQuadInRoot
final List<PointF> getQuadInRoot()
-
fieldByTypeName
final Field fieldByTypeName(String name)
Returns a field given its local or common type name. Returns null if not found.
-
fieldsByTypeName
final List<Field> fieldsByTypeName(String name)
Returns all fields given a local or common field type name.
-
childByDocumentType
final GenericDocument childByDocumentType(String name)
Returns a sub-document given its document type name. Returns null if not found.
-
childrenByDocumentType
final List<GenericDocument> childrenByDocumentType(String name)
Returns all children given their document type name.
-
-
-
-