Class KriptonXPagedLiveDataHandlerImpl<T>
java.lang.Object
com.abubusoft.kripton.androidx.livedata.KriptonXPagedLiveDataHandlerImpl<T>
- Type Parameters:
T- The type of the live data
- All Implemented Interfaces:
LiveDataHandler
public abstract class KriptonXPagedLiveDataHandlerImpl<T> extends java.lang.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 Summary
Constructors Constructor Description KriptonXPagedLiveDataHandlerImpl(Paginator<T> pagedResult)Creates a computable live data which is computed when there are active observers. -
Method Summary
Modifier and Type Method Description protected abstract Tcompute()Compute.PagedLiveData<T>getLiveData()Returns the LiveData managed by this class.voidinvalidate()Invalidates the LiveData.
-
Constructor Details
-
KriptonXPagedLiveDataHandlerImpl
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 tocompute()if there are active observers (or when they start observing)
-
-
Method Details
-
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:
invalidatein interfaceLiveDataHandler
-
compute
Compute.- Returns:
- the t
-