ResultRepository

interface ResultRepository<T>

Provides access to the scanning result of the given type by ResultId The current implementation of the repository keeps the result only in RAM and does not store anything on the persistent storage It is important to persist the data manually if it is needed to be used after the restart of the process of the application Be careful when processing the intent with ResultId in onCreate method of the Activity as it may be recreated after the termination of the process

Inheritors

Properties

Link copied to clipboard
abstract val acceptedType: Class<T>

Each result repository works with a single class.

Functions

Link copied to clipboard
abstract fun addResult(result: T): ResultWrapper<T>

Allows to add a scanning result into the repository

Link copied to clipboard
abstract fun clear()

Deletes all the results from the repository

Link copied to clipboard
abstract fun getResult(resultId: ResultId): T?

Returns the result for a given ResultId

Link copied to clipboard
abstract fun getResultAndErase(resultId: ResultId): T?

Returns the result for a given ResultId and delete it from the repository Use this method if you just need to process the result after the successful recognition to keep the usage of memory low

Link copied to clipboard
abstract fun removeResult(resultId: ResultId)

Removes the result with a given ResultId from the repository