Class GiftcardManagePresenter<V extends GiftcardManageView>
- java.lang.Object
 - 
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
 - 
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
 - 
- com.cheetahdigital.giftcards.ui.manage.GiftcardManagePresenter<V>
 
 
 
 
- 
- Type Parameters:
 V- an interface which extendsGiftcardManageView
- All Implemented Interfaces:
 com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<V>
public class GiftcardManagePresenter<V extends GiftcardManageView> extends com.cheetahdigital.uikit.architecture.mvp.Presenter<V>This presenter class contains API calls for managing the Gift Card. This is a child class ofPresenterwhich is bound to theGiftcardManageView, which means that this will be used to display theGiftcardobject to a view of typeGiftcardManageView 
- 
- 
Constructor Summary
Constructors Constructor Description GiftcardManagePresenter() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard>getGiftcardLinkReceivedListener()Create a listener forGiftcardsAPIprotected GiftcardsAPIgetGiftcardsAPI()Get current instance ofGiftcardsAPIprotected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard>getGiftcardUnLinkReceivedListener()Create a listener forGiftcardsAPIvoidlinkGiftcard(java.lang.String cardNumber, java.lang.String pin)Adds a gift card to the account of the member.voidlinkGiftcard(java.lang.String cardNumber, java.lang.String pin, GiftcardFields fieldParams, GiftcardParams queryParams)Adds a gift card to the account of the member.protected voidonGiftcardLinkFailed(java.lang.String error)Called after receiving a failed response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)protected voidonGiftcardLinkSuccess(Giftcard data)Called after receiving a success response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)protected voidonGiftcardUnLinkFailed(java.lang.String error)Called after receiving a failed response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)protected voidonGiftcardUnLinkSuccess(Giftcard data)Called after receiving a success response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)voidunlinkGiftcard(java.lang.String cardNumber)Removes a gift card from the account of the membervoidunlinkGiftcard(java.lang.String cardNumber, GiftcardParams queryParams)Removes a gift card from the account of the member 
 - 
 
- 
- 
Method Detail
- 
getGiftcardLinkReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard> getGiftcardLinkReceivedListener()
Create a listener forGiftcardsAPI- Returns:
 - listener to handle 
GiftcardsAPIrequests 
 
- 
getGiftcardUnLinkReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard> getGiftcardUnLinkReceivedListener()
Create a listener forGiftcardsAPI- Returns:
 - listener to handle 
GiftcardsAPIrequests 
 
- 
getGiftcardsAPI
protected GiftcardsAPI getGiftcardsAPI()
Get current instance ofGiftcardsAPI- Returns:
 GiftcardsAPIused on this presenter
 
- 
linkGiftcard
public void linkGiftcard(java.lang.String cardNumber, @NonNull java.lang.String pin)Adds a gift card to the account of the member. Remember to set the pin of the gift card by usingGiftcardFields.setPin(String).- Parameters:
 cardNumber- the code of gift cardpin- theGiftcardFieldsto link a gift card to an account
 
- 
linkGiftcard
public void linkGiftcard(java.lang.String cardNumber, @NonNull java.lang.String pin, GiftcardFields fieldParams, GiftcardParams queryParams)Adds a gift card to the account of the member. Remember to set the pin of the gift card by usingGiftcardFields.setPin(String).- Parameters:
 cardNumber- the code of gift cardpin- theGiftcardFieldsto link a gift card to an accountfieldParams- theGiftcardFieldsto link a gift card to an accountqueryParams- theGiftcardParamsto use for linking a gift card
 
- 
unlinkGiftcard
public void unlinkGiftcard(java.lang.String cardNumber)
Removes a gift card from the account of the member- Parameters:
 cardNumber- the code of the gift card to remove
 
- 
unlinkGiftcard
public void unlinkGiftcard(java.lang.String cardNumber, GiftcardParams queryParams)Removes a gift card from the account of the member- Parameters:
 cardNumber- the code of the gift card to removequeryParams-GiftcardParamsto use for unlinking giftcard
 
- 
onGiftcardLinkSuccess
protected void onGiftcardLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)- Parameters:
 data-Giftcardreceived
 
- 
onGiftcardLinkFailed
protected void onGiftcardLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)- Parameters:
 error- contains the message of the error
 
- 
onGiftcardUnLinkFailed
protected void onGiftcardUnLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)- Parameters:
 error- contains the message of the error
 
- 
onGiftcardUnLinkSuccess
protected void onGiftcardUnLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)- Parameters:
 data-Giftcardreceived
 
 - 
 
 -