Package io.scanbot.sdk.barcode.ui.result
Class BarcodeScannerUiResultInternalLruStorage
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.result.ResultStorage
public final class BarcodeScannerUiResultInternalLruStorage implements ResultStorage<BarcodeScannerUiResultInternal>
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
public final static Integer
BARCODE_DATA_MULTIPLIER
private final Class<BarcodeScannerUiResultInternal>
acceptedType
-
Constructor Summary
Constructors Constructor Description BarcodeScannerUiResultInternalLruStorage()
-
Method Summary
Modifier and Type Method Description Class<BarcodeScannerUiResultInternal>
getAcceptedType()
Unit
putResult(String resultId, BarcodeScannerUiResultInternal result)
Puts the given result to the storage on the given id BarcodeScannerUiResultInternal
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<BarcodeScannerUiResultInternal> getAcceptedType()
-
putResult
Unit putResult(String resultId, BarcodeScannerUiResultInternal result)
Puts the given result to the storage on the given id
- Parameters:
resultId
- id to store the result onresult
- result to store
-
getResult
BarcodeScannerUiResultInternal 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
-
-