Package net.gini.android
Class DocumentTaskManager.DocumentUploadBuilder
- java.lang.Object
-
- net.gini.android.DocumentTaskManager.DocumentUploadBuilder
-
- Enclosing class:
- DocumentTaskManager
public static class DocumentTaskManager.DocumentUploadBuilder extends java.lang.Object
A builder to configure the upload of a bitmap.
-
-
Constructor Summary
Constructors Constructor Description DocumentUploadBuilder()
DocumentUploadBuilder(android.graphics.Bitmap documentBitmap)
Deprecated.UseDocumentUploadBuilder()
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DocumentTaskManager.DocumentUploadBuilder
setCompressionRate(int compressionRate)
Deprecated.The default compression rate is set to get the best extractions for the smallest image byte size.DocumentTaskManager.DocumentUploadBuilder
setDocumentBitmap(android.graphics.Bitmap documentBitmap)
Set the document as aBitmap
.DocumentTaskManager.DocumentUploadBuilder
setDocumentBytes(byte[] documentBytes)
Set the document as a byte array.DocumentTaskManager.DocumentUploadBuilder
setDocumentType(java.lang.String documentType)
Deprecated.UsesetDocumentType(DocumentType)
instead.DocumentTaskManager.DocumentUploadBuilder
setDocumentType(DocumentTaskManager.DocumentType documentType)
Set the document's type.DocumentTaskManager.DocumentUploadBuilder
setFilename(java.lang.String filename)
Set the document' s filename.bolts.Task<Document>
upload(DocumentTaskManager documentTaskManager)
Use the given DocumentTaskManager instance to upload the document with all the features which were set with this builder.
-
-
-
Constructor Detail
-
DocumentUploadBuilder
public DocumentUploadBuilder()
-
DocumentUploadBuilder
@Deprecated public DocumentUploadBuilder(@NonNull android.graphics.Bitmap documentBitmap)
Deprecated.UseDocumentUploadBuilder()
instead.- Parameters:
documentBitmap
- A Bitmap representing the image.
-
-
Method Detail
-
setDocumentBytes
public DocumentTaskManager.DocumentUploadBuilder setDocumentBytes(@NonNull byte[] documentBytes)
Set the document as a byte array. If aBitmap
was also set, the bitmap will be used.
-
setDocumentBitmap
public DocumentTaskManager.DocumentUploadBuilder setDocumentBitmap(@NonNull android.graphics.Bitmap documentBitmap)
Set the document as aBitmap
. This bitmap will be used instead of the byte array, if both were set.
-
setFilename
public DocumentTaskManager.DocumentUploadBuilder setFilename(@NonNull java.lang.String filename)
Set the document' s filename.
-
setDocumentType
@Deprecated public DocumentTaskManager.DocumentUploadBuilder setDocumentType(@NonNull java.lang.String documentType)
Deprecated.UsesetDocumentType(DocumentType)
instead.Set the document's type. (This feature is called document type hint in the Gini API documentation). By providing the doctype, Gini’s document processing is optimized in many ways.
-
setDocumentType
public DocumentTaskManager.DocumentUploadBuilder setDocumentType(@NonNull DocumentTaskManager.DocumentType documentType)
Set the document's type. (This feature is called document type hint in the Gini API documentation). By providing the doctype, Gini’s document processing is optimized in many ways.
-
setCompressionRate
@Deprecated public DocumentTaskManager.DocumentUploadBuilder setCompressionRate(int compressionRate)
Deprecated.The default compression rate is set to get the best extractions for the smallest image byte size.The bitmap (if set) will be converted into a JPEG representation. Set the compression rate for the JPEG representation.
-
upload
public bolts.Task<Document> upload(@NonNull DocumentTaskManager documentTaskManager)
Use the given DocumentTaskManager instance to upload the document with all the features which were set with this builder.- Parameters:
documentTaskManager
- The instance of a DocumentTaskManager whill will be used to upload the document.- Returns:
- A task which will resolve to a Document instance.
-
-