Interface ResultRepository

  • All Implemented Interfaces:

    
    public interface ResultRepository<T extends Object>
    
                        

    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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract ResultWrapper<T> addResult(T result) Allows to add a scanning result into the repository
      abstract T getResult(String resultId) Returns the result for a given ResultId
      abstract T getResultAndErase(String resultId) 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
      abstract Unit removeResult(String resultId) Removes the result with a given ResultId from the repository
      abstract Unit clear() Deletes all the results from the repository
      abstract Class<T> getAcceptedType() Each result repository works with a single class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • addResult

         abstract ResultWrapper<T> addResult(T result)

        Allows to add a scanning result into the repository

        Parameters:
        result - result object which should be added
      • getResult

         abstract T getResult(String resultId)

        Returns the result for a given ResultId

        Parameters:
        resultId - id to find the result for
      • getResultAndErase

         abstract T getResultAndErase(String resultId)

        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

      • removeResult

         abstract Unit removeResult(String resultId)

        Removes the result with a given ResultId from the repository

        Parameters:
        resultId - id to delete the result
      • clear

         abstract Unit clear()

        Deletes all the results from the repository