Class ReceiptDetailsPresenter<T extends ReceiptDetailsView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
-
- com.cheetahdigital.receipt.ui.detail.ReceiptDetailsPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class ReceiptDetailsPresenter<T extends ReceiptDetailsView> extends LcePresenter<T>
-
-
Constructor Summary
Constructors Constructor Description ReceiptDetailsPresenter(java.lang.String receiptId)Default constructor that acceptsReceiptParamsneeded forReceiptAPIReceiptDetailsPresenter(java.lang.String receiptId, ReceiptParams receiptParams)Default constructor that acceptsReceiptParamsneeded forReceiptAPI
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ReceiptAPIgetReceiptAPI()Get current instance ofReceiptAPIprotected ListenerModel<BaseModel<Receipt>,Receipt>getReceiptDetailReceivedListener()Create a listener forReceiptAPIvoidloadData()Load initial view data.protected voidonReceiptDetailReceivedFailed(java.lang.String error)Called after a failed response fromReceiptAPI.getReceipt(ReceiptParams, boolean, ListenerModel)protected voidonReceiptDetailReceivedSuccess(Receipt data)Called after a successful response fromReceiptAPI.getReceipt(ReceiptParams, boolean, ListenerModel)-
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
-
ReceiptDetailsPresenter
public ReceiptDetailsPresenter(java.lang.String receiptId)
Default constructor that acceptsReceiptParamsneeded forReceiptAPI- Parameters:
receiptId- id of the receipt details
-
ReceiptDetailsPresenter
public ReceiptDetailsPresenter(java.lang.String receiptId, ReceiptParams receiptParams)Default constructor that acceptsReceiptParamsneeded forReceiptAPI- Parameters:
receiptId- id of the receipt detailsreceiptParams- theReceiptParamsneeded forReceiptAPI
-
-
Method Detail
-
getReceiptDetailReceivedListener
protected ListenerModel<BaseModel<Receipt>,Receipt> getReceiptDetailReceivedListener()
Create a listener forReceiptAPI- Returns:
- listener to handle
ReceiptAPIrequests
-
getReceiptAPI
protected ReceiptAPI getReceiptAPI()
Get current instance ofReceiptAPI- Returns:
ReceiptAPIused on this presenter
-
onReceiptDetailReceivedFailed
protected void onReceiptDetailReceivedFailed(java.lang.String error)
Called after a failed response fromReceiptAPI.getReceipt(ReceiptParams, boolean, ListenerModel)- Parameters:
error- detail of the error
-
onReceiptDetailReceivedSuccess
protected void onReceiptDetailReceivedSuccess(Receipt data)
Called after a successful response fromReceiptAPI.getReceipt(ReceiptParams, boolean, ListenerModel)- Parameters:
data-Receiptresponse
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<T extends ReceiptDetailsView>
-
-