Class KriptonXPagedLiveDataHandlerImpl<T>

  • Type Parameters:
    T - The type of the live data
    All Implemented Interfaces:
    LiveDataHandler

    public abstract class KriptonXPagedLiveDataHandlerImpl<T>
    extends Object
    implements LiveDataHandler
    A PLiveData class that can be invalidated and computed on demand.

    This is an internal class for now, might be public if we see the necessity.

    • Constructor Detail

      • KriptonXPagedLiveDataHandlerImpl

        public KriptonXPagedLiveDataHandlerImpl​(Paginator<T> pagedResult)
        Creates a computable live data which is computed when there are active observers.

        It can also be invalidated via invalidate() which will result in a call to compute() if there are active observers (or when they start observing)

    • Method Detail

      • getLiveData

        @NonNull
        public PagedLiveData<T> getLiveData()
        Returns the LiveData managed by this class.
        Returns:
        A LiveData that is controlled by ComputableLiveData.
      • invalidate

        public void invalidate()
        Invalidates the LiveData.

        When there are active observers, this will trigger a call to compute().

        Specified by:
        invalidate in interface LiveDataHandler
      • compute

        @WorkerThread
        protected abstract T compute()
        Compute.
        Returns:
        the t