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 classGenericDocument.TypeDocument type
-
Field Summary
Fields Modifier and Type Field Description private final GenericDocument.Typetypeprivate final List<Field>fieldsprivate final List<GenericDocument>childrenprivate final Floatconfidenceprivate final FloatconfidenceWeightprivate final List<PointF>quadprivate final List<PointF>quadInRootprivate final Bitmapcrop
-
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.TypegetType()document type final List<Field>getFields()a list of document fields final List<GenericDocument>getChildren()a list of sub-documents final FloatgetConfidence()the average confidence in the accuracy of the document recognition result final FloatgetConfidenceWeight()the weight of the confidence. final List<PointF>getQuad()final List<PointF>getQuadInRoot()final BitmapgetCrop()final FieldfieldByTypeName(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 GenericDocumentchildByDocumentType(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.
-
-
-
-