Class SubmitReferralCodePresenter<T extends SubmitReferralCodeView>
- 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.referral.ui.submitreferral.SubmitReferralCodePresenter<T>
-
- Type Parameters:
T
- theView
class
- All Implemented Interfaces:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>
public class SubmitReferralCodePresenter<T extends SubmitReferralCodeView> extends com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
ThePresenter
class forSubmitReferralCodeFragment
. This contains the submit referral code API calls
-
-
Constructor Summary
Constructors Constructor Description SubmitReferralCodePresenter()
SubmitReferralCodePresenter(ReferralParams referralParams)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.cheetahdigital.profile.core.api.ProfileAPI
getProfileAPI()
Get current instance ofProfileAPI
protected ReferralAPI
getReferralAPI()
Get current instance ofReferralAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<ReferralCode>>,java.util.List<ReferralCode>>
getReferralCodesReceivedListener()
Create a listener forReferralAPI
protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse>
getSubmitReferralListener()
Create a listener forProfileAPI
void
loadData()
Load initial view data.protected void
onReferralCodesReceivedFailed(java.lang.String error)
Called after a successful referral codes requestprotected void
onReferralCodesReceivedSuccess(java.util.List<ReferralCode> data)
Called after a successful referral codes requestprotected void
onSubmitReferralFailed(java.lang.String error)
Called after a failed submission of referral codeprotected void
onSubmitReferralSuccess(com.cheetahdigital.corekit.models.responses.SuccessResponse data)
Called after a successful submission of referral codevoid
submitReferralCode(java.lang.String code)
Attempt to submit referral codevoid
submitReferralCode(java.lang.String code, com.cheetahdigital.profile.core.api.ProfileParams profileParams)
Attempt to submit referral code-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
-
-
-
Constructor Detail
-
SubmitReferralCodePresenter
public SubmitReferralCodePresenter()
-
SubmitReferralCodePresenter
public SubmitReferralCodePresenter(ReferralParams referralParams)
-
-
Method Detail
-
getReferralCodesReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<ReferralCode>>,java.util.List<ReferralCode>> getReferralCodesReceivedListener()
Create a listener forReferralAPI
- Returns:
- listener to handle
ReferralAPI
requests
-
getSubmitReferralListener
protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getSubmitReferralListener()
Create a listener forProfileAPI
- Returns:
- listener to handle
ProfileAPI
requests
-
getReferralAPI
protected ReferralAPI getReferralAPI()
Get current instance ofReferralAPI
- Returns:
ReferralAPI
used on this presenter
-
getProfileAPI
protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
Get current instance ofProfileAPI
- Returns:
ProfileAPI
used on this presenter
-
loadData
public void loadData()
Description copied from class:com.cheetahdigital.uikit.architecture.lce.LcePresenter
Load initial view data.- Specified by:
loadData
in classcom.cheetahdigital.uikit.architecture.lce.LcePresenter<T extends SubmitReferralCodeView>
-
onReferralCodesReceivedFailed
protected void onReferralCodesReceivedFailed(java.lang.String error)
Called after a successful referral codes request- Parameters:
error
- contains the details of the error
-
onReferralCodesReceivedSuccess
protected void onReferralCodesReceivedSuccess(java.util.List<ReferralCode> data)
Called after a successful referral codes request- Parameters:
data
- received response in list ofReferralCode
format
-
submitReferralCode
public void submitReferralCode(java.lang.String code)
Attempt to submit referral code- Parameters:
code
- referral code
-
submitReferralCode
public void submitReferralCode(java.lang.String code, com.cheetahdigital.profile.core.api.ProfileParams profileParams)
Attempt to submit referral code- Parameters:
code
- referral codeprofileParams
-ProfileParams
to use
-
onSubmitReferralFailed
protected void onSubmitReferralFailed(java.lang.String error)
Called after a failed submission of referral code- Parameters:
error
- contains the detail of the error
-
onSubmitReferralSuccess
protected void onSubmitReferralSuccess(com.cheetahdigital.corekit.models.responses.SuccessResponse data)
Called after a successful submission of referral code- Parameters:
data
- response inSuccessResponse
format
-
-