Class GenericDocumentResultLruStorage
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.result.ResultStorage
public final class GenericDocumentResultLruStorage implements ResultStorage<GenericDocument>
Stores and provides access to the scanning result of the given type by ResultId This implementation uses LRU cache as a storage to keep the memory usage low even if many results will be added to the storage
-
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
LRU_CACHE_SIZE
private final Class<GenericDocument>
acceptedType
-
Constructor Summary
Constructors Constructor Description GenericDocumentResultLruStorage()
-
Method Summary
Modifier and Type Method Description Class<GenericDocument>
getAcceptedType()
Unit
putResult(String resultId, GenericDocument result)
Puts the given result to the storage on the given id GenericDocument
getResult(String resultId)
Returns the result from the storage according to the given id Unit
removeResult(String resultId)
Removes the result from the storage according to the given id Unit
clear()
Removes all the results from the storage -
-
Method Detail
-
getAcceptedType
Class<GenericDocument> getAcceptedType()
-
putResult
Unit putResult(String resultId, GenericDocument result)
Puts the given result to the storage on the given id
- Parameters:
resultId
- id to store the result onresult
- result to store
-
getResult
GenericDocument getResult(String resultId)
Returns the result from the storage according to the given id
- Parameters:
resultId
- id to return the result from
-
removeResult
Unit removeResult(String resultId)
Removes the result from the storage according to the given id
- Parameters:
resultId
- id to remove the result on
-
-
-
-