Class SubmitReferralCodePresenter<T extends SubmitReferralCodeView>

  • Type Parameters:
    T - the View 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>
    The Presenter class for SubmitReferralCodeFragment. This contains the submit referral code API calls
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
      Get current instance of ProfileAPI
      protected ReferralAPI getReferralAPI()
      Get current instance of ReferralAPI
      protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<ReferralCode>>,​java.util.List<ReferralCode>> getReferralCodesReceivedListener()
      Create a listener for ReferralAPI
      protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getSubmitReferralListener()
      Create a listener for ProfileAPI
      void loadData()
      Load initial view data.
      protected void onReferralCodesReceivedFailed​(java.lang.String error)
      Called after a successful referral codes request
      protected void onReferralCodesReceivedSuccess​(java.util.List<ReferralCode> data)
      Called after a successful referral codes request
      protected void onSubmitReferralFailed​(java.lang.String error)
      Called after a failed submission of referral code
      protected void onSubmitReferralSuccess​(com.cheetahdigital.corekit.models.responses.SuccessResponse data)
      Called after a successful submission of referral code
      void submitReferralCode​(java.lang.String code)
      Attempt to submit referral code
      void 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
      • Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter

        attachView, detachView, getView
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 for ReferralAPI
        Returns:
        listener to handle ReferralAPI requests
      • getSubmitReferralListener

        protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getSubmitReferralListener()
        Create a listener for ProfileAPI
        Returns:
        listener to handle ProfileAPI requests
      • getProfileAPI

        protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
        Get current instance of ProfileAPI
        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 class com.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 of ReferralCode 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 code
        profileParams - 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 in SuccessResponse format