Class GiftcardHistoryPresenter<V extends GiftcardHistoryView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<V>
-
- com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<V>
-
- com.cheetahdigital.uikit.widget.list.ListPresenter<V>
-
- com.cheetahdigital.uikit.widget.list.EndlessListPresenter<V>
-
- com.cheetahdigital.giftcards.ui.history.GiftcardHistoryPresenter<V>
-
- Type Parameters:
V
- an interface that extends theGiftcardHistoryView
- All Implemented Interfaces:
MvpPresenter<V>
public class GiftcardHistoryPresenter<V extends GiftcardHistoryView> extends EndlessListPresenter<V>
This presenter class contains the API calls for getting the gift card transactions using the Gift Card module. This is a child class ofEndlessListPresenter
which is bound to theGiftcardHistoryView
, which means that this will be used to display theTransactions
object to a view of typeGiftcardHistoryView
-
-
Constructor Summary
Constructors Constructor Description GiftcardHistoryPresenter(java.lang.String cardNumber)
Constructor of this presenterGiftcardHistoryPresenter(java.lang.String cardNumber, GiftcardParams queryParams)
Constructor of this presenter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GiftcardsAPI
getGiftcardsAPI()
Get current instance ofGiftcardsAPI
protected ListenerModel<BaseModel<Transactions>,Transactions>
getTransactionsReceivedListener()
Create a listener forGiftcardsAPI
void
loadData()
Load initial view data.void
loadMore(int currentPage)
void
onLoadMoreSuccess(BaseData data)
End of load more with success requestvoid
onRefreshSuccess(BaseData data)
End of refresh with success request.void
refreshData()
Start the refresh view data.-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListPresenter
isAppending, onLoadMoreFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
isRefreshing, onRefreshFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
GiftcardHistoryPresenter
public GiftcardHistoryPresenter(java.lang.String cardNumber)
Constructor of this presenter- Parameters:
cardNumber
- code of gift card
-
GiftcardHistoryPresenter
public GiftcardHistoryPresenter(java.lang.String cardNumber, GiftcardParams queryParams)
Constructor of this presenter- Parameters:
cardNumber
- code of gift cardqueryParams
- customGiftcardParams
for transactions API call inloadData()
-
-
Method Detail
-
getTransactionsReceivedListener
protected ListenerModel<BaseModel<Transactions>,Transactions> getTransactionsReceivedListener()
Create a listener forGiftcardsAPI
- Returns:
- listener to handle
GiftcardsAPI
requests
-
getGiftcardsAPI
protected GiftcardsAPI getGiftcardsAPI()
Get current instance ofGiftcardsAPI
- Returns:
GiftcardsAPI
used on this presenter
-
loadData
public void loadData()
Description copied from class:LcePresenter
Load initial view data.- Specified by:
loadData
in classLcePresenter<V extends GiftcardHistoryView>
-
refreshData
public void refreshData()
Description copied from class:RefreshablePresenter
Start the refresh view data.- Overrides:
refreshData
in classRefreshablePresenter<V extends GiftcardHistoryView>
-
loadMore
public void loadMore(int currentPage)
- Overrides:
loadMore
in classEndlessListPresenter<V extends GiftcardHistoryView>
-
onRefreshSuccess
public void onRefreshSuccess(BaseData data)
Description copied from class:RefreshablePresenter
End of refresh with success request.- Overrides:
onRefreshSuccess
in classRefreshablePresenter<V extends GiftcardHistoryView>
- Parameters:
data
- theBaseData
.
-
onLoadMoreSuccess
public void onLoadMoreSuccess(BaseData data)
Description copied from class:EndlessListPresenter
End of load more with success request- Overrides:
onLoadMoreSuccess
in classEndlessListPresenter<V extends GiftcardHistoryView>
- Parameters:
data
- instance ofBaseData
passed
-
-